diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-07-22 06:30:49 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-07-22 06:30:49 +0000 |
commit | 63c99943a0f9195becaf95090441d5543ffc8b21 (patch) | |
tree | c04b9f12d9e5f139d69c1343346ee79de6e26b81 /examples | |
parent | 2853095fb45c4c2cef5a32b8fecd2d9d1bd1f963 (diff) | |
download | libgphoto2-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.c | 4 |
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); |