From a3b9afebf03ff9e05fb61072223dc7dda2a00a47 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 1 Jun 2014 17:15:21 +0000 Subject: [PATCH] handle an error (coverity) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14984 67ed7778-7388-44ab-90cf-0a291f65f57c --- examples/sample-trigger-capture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))