diff options
author | Andrew Tridgell <tridge@samba.org> | 2013-12-08 20:46:43 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-12-10 11:39:14 +0100 |
commit | 038ec194ae55c94d566a62f9e6e7dbcc0e0e7399 (patch) | |
tree | bb6f44722cec61cea6f5c4745a4bcd257673d274 /src/drivers | |
parent | 1bac7e7f8b073a7e5cee12570e42694988df1abc (diff) | |
download | px4-firmware-038ec194ae55c94d566a62f9e6e7dbcc0e0e7399.tar.gz px4-firmware-038ec194ae55c94d566a62f9e6e7dbcc0e0e7399.tar.bz2 px4-firmware-038ec194ae55c94d566a62f9e6e7dbcc0e0e7399.zip |
lsm303d: close fds before exit
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/lsm303d/lsm303d.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index cb4b0b5d1..4d7c8f05a 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -1770,6 +1770,8 @@ start() } } + close(fd); + close(fd_mag); exit(0); fail: @@ -1851,6 +1853,9 @@ test() /* XXX add poll-rate tests here too */ + close(fd_accel); + close(fd_mag); + reset(); errx(0, "PASS"); } @@ -1872,6 +1877,8 @@ reset() if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0) err(1, "accel pollrate reset failed"); + close(fd); + fd = open(LSM303D_DEVICE_PATH_MAG, O_RDONLY); if (fd < 0) { @@ -1882,6 +1889,8 @@ reset() err(1, "mag pollrate reset failed"); } + close(fd); + exit(0); } |