diff --git a/examples/sample-trigger-capture.c b/examples/sample-trigger-capture.c index 0d8189ae4..c5b13faa9 100644 --- a/examples/sample-trigger-capture.c +++ b/examples/sample-trigger-capture.c @@ -103,7 +103,10 @@ wait_event_and_download (Camera *camera, int waittime, GPContext *context) { fd = creat(queue[0].path.name, 0644); else fd = open(queue[0].path.name, O_RDWR, 0644); - if (fd == -1) perror(queue[0].path.name); + if (fd == -1) { + perror(queue[0].path.name); + return GP_ERROR; + } if (-1 == lseek(fd, queue[0].offset, SEEK_SET)) perror("lseek"); if (-1 == write (fd, buffer, size))