aboutsummaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2013-12-08 20:46:31 +1100
committerLorenz Meier <lm@inf.ethz.ch>2013-12-10 12:06:18 +0100
commit09ece4306e929b9ffbd7d21a50c5d3d21265bd87 (patch)
treec0e3f843ac6bcf0256a01558f826174cabee563e /src/drivers
parent1fc122562c16dfd419e832b95292678a7db8ec22 (diff)
downloadpx4-firmware-09ece4306e929b9ffbd7d21a50c5d3d21265bd87.tar.gz
px4-firmware-09ece4306e929b9ffbd7d21a50c5d3d21265bd87.tar.bz2
px4-firmware-09ece4306e929b9ffbd7d21a50c5d3d21265bd87.zip
l3gd20: close fds before exit
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/l3gd20/l3gd20.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/l3gd20/l3gd20.cpp b/src/drivers/l3gd20/l3gd20.cpp
index 78a086b11..910131c6a 100644
--- a/src/drivers/l3gd20/l3gd20.cpp
+++ b/src/drivers/l3gd20/l3gd20.cpp
@@ -942,6 +942,8 @@ start()
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
goto fail;
+ close(fd);
+
exit(0);
fail:
@@ -990,6 +992,8 @@ test()
warnx("gyro range: %8.4f rad/s (%d deg/s)", (double)g_report.range_rad_s,
(int)((g_report.range_rad_s / M_PI_F) * 180.0f + 0.5f));
+ close(fd_gyro);
+
/* XXX add poll-rate tests here too */
reset();
@@ -1013,6 +1017,8 @@ reset()
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
err(1, "accel pollrate reset failed");
+ close(fd);
+
exit(0);
}