summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-07-22 06:30:49 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-07-22 06:30:49 +0000
commit63c99943a0f9195becaf95090441d5543ffc8b21 (patch)
treec04b9f12d9e5f139d69c1343346ee79de6e26b81 /examples
parent2853095fb45c4c2cef5a32b8fecd2d9d1bd1f963 (diff)
downloadlibgphoto2-63c99943a0f9195becaf95090441d5543ffc8b21.tar.gz
handle "no camera" case
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15100 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'examples')
-rw-r--r--examples/sample-multi-detect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/sample-multi-detect.c b/examples/sample-multi-detect.c
index 4dc7d443a..2099b8cf0 100644
--- a/examples/sample-multi-detect.c
+++ b/examples/sample-multi-detect.c
@@ -25,6 +25,10 @@ int main(int argc, char **argv) {
ret = gp_list_new (&list);
if (ret < GP_OK) return 1;
count = sample_autodetect (list, context);
+ if (count < GP_OK) {
+ printf("No cameras detected.\n");
+ return 1;
+ }
/* Now open all cameras we autodected for usage */
printf("Number of cameras: %d\n", count);