aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/hmc5883/hmc5883.cpp
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-28 16:29:14 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-28 16:29:14 +0100
commit2728889f7886e3ab2fea16941d29e60ece0d4449 (patch)
treeca9994d71205731ee4bb404175c2cf8f13fcc539 /src/drivers/hmc5883/hmc5883.cpp
parentf23e603d02ba416ae250770cdaad6a859d6bae69 (diff)
parent1dcc5c49cc75778bcdde770f2d6c2700dd2bec2e (diff)
downloadpx4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.gz
px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.tar.bz2
px4-firmware-2728889f7886e3ab2fea16941d29e60ece0d4449.zip
Merge remote-tracking branch 'upstream/master' into ros_messagelayer_merge_attctlposctl
Diffstat (limited to 'src/drivers/hmc5883/hmc5883.cpp')
-rw-r--r--src/drivers/hmc5883/hmc5883.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/drivers/hmc5883/hmc5883.cpp b/src/drivers/hmc5883/hmc5883.cpp
index 95fbed0ba..a06be72d9 100644
--- a/src/drivers/hmc5883/hmc5883.cpp
+++ b/src/drivers/hmc5883/hmc5883.cpp
@@ -1351,13 +1351,15 @@ start_bus(struct hmc5883_bus_option &bus, enum Rotation rotation)
}
int fd = open(bus.devpath, O_RDONLY);
- if (fd < 0)
+ if (fd < 0) {
return false;
+ }
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) {
close(fd);
errx(1,"Failed to setup poll rate");
}
+ close(fd);
return true;
}