mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 17:47:35 +08:00
Servo test: Ensure we only close an open FD
This commit is contained in:
@@ -116,6 +116,8 @@ int test_servo(int argc, char *argv[])
|
||||
printf("Advancing channel 1 to 1800\n");
|
||||
result = ioctl(fd, PWM_SERVO_SET(1), 1800);
|
||||
out:
|
||||
close(fd);
|
||||
if (fd >= 0) {
|
||||
close(fd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user