Skip to content

Commit

Permalink
exit interval loop on errors
Browse files Browse the repository at this point in the history
  • Loading branch information
msmeissn committed Feb 8, 2019
1 parent 237aab5 commit 7a48ea3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gphoto2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ capture_generic (CameraCaptureType type, const char __unused__ *name, int downlo
*/
if (glob_interval != -1) {
waittime = timediff_now (&next_pic_time);
result = GP_OK;
if (waittime > 0) {
if (!(gp_params.flags & FLAGS_QUIET) && glob_interval)
printf (_("Waiting for next capture slot %ld seconds...\n"), waittime/1000);
Expand All @@ -1098,6 +1099,7 @@ capture_generic (CameraCaptureType type, const char __unused__ *name, int downlo
if (!(gp_params.flags & FLAGS_QUIET) && glob_interval)
printf (_("not sleeping (%ld seconds behind schedule)\n"), -waittime/1000);
}
if (result != GP_OK) break;
if (capture_now && (gp_params.flags & FLAGS_RESET_CAPTURE_INTERVAL)) {
gettimeofday (&next_pic_time, NULL);
next_pic_time.tv_sec += glob_interval;
Expand Down Expand Up @@ -1154,7 +1156,7 @@ capture_generic (CameraCaptureType type, const char __unused__ *name, int downlo
}

signal(SIGUSR1, SIG_DFL);
return (GP_OK);
return GP_OK;
}


Expand Down

0 comments on commit 7a48ea3

Please sign in to comment.