Servo test: Ensure we only close an open FD

This commit is contained in:
Lorenz Meier
2017-01-12 02:31:15 +01:00
parent 8c7f810cc2
commit 61d7f22aba
+3 -1
View File
@@ -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;
}