summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2016-11-19 21:23:02 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-11-19 21:23:02 +0100
commit0ff0f34c7a1b06da21410550da1ef185adcb29c4 (patch)
treeaff0a33c5af56abf8776c5ff0457ef8e51c2b094 /examples
parentbc92763213343acbdd863d03996be4d6f8fb5caf (diff)
downloadlibgphoto2-0ff0f34c7a1b06da21410550da1ef185adcb29c4.tar.gz
check for open return
Diffstat (limited to 'examples')
-rw-r--r--examples/sample-photobooth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/sample-photobooth.c b/examples/sample-photobooth.c
index 43a5bb259..65327152e 100644
--- a/examples/sample-photobooth.c
+++ b/examples/sample-photobooth.c
@@ -44,6 +44,9 @@ capture_to_file(Camera *camera, GPContext *context, char *fn) {
}
fd = open(fn, O_CREAT | O_WRONLY, 0644);
+ if (fd == -1)
+ return GP_ERROR;
+
retval = gp_file_new_from_fd(&file, fd);
if (retval < GP_OK) {
close(fd);