Browse Source

Servo test: Ensure we only close an open FD

sbg
Lorenz Meier 8 years ago
parent
commit
61d7f22aba
  1. 4
      src/systemcmds/tests/test_servo.c

4
src/systemcmds/tests/test_servo.c

@ -116,6 +116,8 @@ int test_servo(int argc, char *argv[]) @@ -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;
}

Loading…
Cancel
Save