Skip to content

Commit

Permalink
Return a non-zero return value on a capture error
Browse files Browse the repository at this point in the history
  • Loading branch information
fsphil committed Jan 14, 2017
1 parent 03ca8d6 commit 1ce8598
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fswebcam.c
Expand Up @@ -1598,6 +1598,7 @@ int fswc_free_config(fswebcam_config_t *config)
int main(int argc, char *argv[])
{
fswebcam_config_t *config;
int r;

/* Set the locale to the system default */
setlocale(LC_ALL, "");
Expand Down Expand Up @@ -1629,7 +1630,7 @@ int main(int argc, char *argv[])
if(!gdFTUseFontConfig(1)) DEBUG("gd has no fontconfig support");

/* Capture the image(s). */
if(!config->loop) fswc_grab(config);
if(!config->loop) r = fswc_grab(config);
else
{
/* Loop mode ... keep capturing images until terminated. */
Expand Down Expand Up @@ -1686,7 +1687,7 @@ int main(int argc, char *argv[])
received_sigusr1 = 0;

/* Capture the image. */
fswc_grab(config);
r = fswc_grab(config);
}
}

Expand All @@ -1697,6 +1698,6 @@ int main(int argc, char *argv[])
fswc_free_config(config);
free(config);

return(0);
return(r);
}

0 comments on commit 1ce8598

Please sign in to comment.