mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 22:43:34 +08:00
mpu6000: close fds before exit
This commit is contained in:
committed by
Lorenz Meier
parent
038ec194ae
commit
39b40e41c2
@@ -1405,6 +1405,8 @@ start()
|
|||||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
|
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
fail:
|
fail:
|
||||||
|
|
||||||
@@ -1508,6 +1510,8 @@ reset()
|
|||||||
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
|
if (ioctl(fd, SENSORIOCSPOLLRATE, SENSOR_POLLRATE_DEFAULT) < 0)
|
||||||
err(1, "driver poll restart failed");
|
err(1, "driver poll restart failed");
|
||||||
|
|
||||||
|
close(fd);
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user