From 92d90f7780d69ed7106da53cf43ec4056760af89 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Wed, 1 Apr 2015 18:13:59 -0700 Subject: [PATCH] Linux: ms5611 open, close changed to px4_open, px4_close Calls to open and close were used instead of px4_open and px4_close. Signed-off-by: Mark Charlebois --- src/drivers/ms5611/ms5611_linux.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/drivers/ms5611/ms5611_linux.cpp b/src/drivers/ms5611/ms5611_linux.cpp index 490601b743..4acb2f251b 100644 --- a/src/drivers/ms5611/ms5611_linux.cpp +++ b/src/drivers/ms5611/ms5611_linux.cpp @@ -894,7 +894,7 @@ start_bus(struct ms5611_bus_option &bus) return false; } - int fd = open(bus.devpath, O_RDONLY); + int fd = px4_open(bus.devpath, O_RDONLY); /* set the poll rate to default, starts automatic data collection */ if (fd == -1) { @@ -902,12 +902,12 @@ start_bus(struct ms5611_bus_option &bus) return false; } if (px4_ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) { - close(fd); + px4_close(fd); warnx("failed setting default poll rate"); return false; } - close(fd); + px4_close(fd); return true; } @@ -959,7 +959,6 @@ struct ms5611_bus_option &find_bus(enum MS5611_BUS busid) } // FIXME - This is fatal to all threads errx(1, "bus %u not started", (unsigned)busid); - } /** @@ -977,7 +976,7 @@ test(enum MS5611_BUS busid) int fd; - fd = open(bus.devpath, O_RDONLY); + fd = px4_open(bus.devpath, O_RDONLY); if (fd < 0) { warn("open failed (try 'ms5611 start' if the driver is not running)"); return 1; @@ -1098,7 +1097,7 @@ calibrate(unsigned altitude, enum MS5611_BUS busid) int fd; - fd = open(bus.devpath, O_RDONLY); + fd = px4_open(bus.devpath, O_RDONLY); if (fd < 0) { warn("open failed (try 'ms5611 start' if the driver is not running)");