summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2021-10-02 13:26:40 +0200
committerMarcus Meissner <marcus@jet.franken.de>2021-10-02 13:26:40 +0200
commitdc8cbddac49b7cfc0ad8eaee1f2a367c833a8cca (patch)
treee0cf465378619b56cecad549ce34fa5427db71f9 /examples
parent409dfcedf47f26e38b9e4fd5055d6314b7dd2574 (diff)
downloadlibgphoto2-dc8cbddac49b7cfc0ad8eaee1f2a367c833a8cca.tar.gz
report only if flag set
Diffstat (limited to 'examples')
-rw-r--r--examples/sample-tether.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/sample-tether.c b/examples/sample-tether.c
index c8e8104ea..0e38c12ba 100644
--- a/examples/sample-tether.c
+++ b/examples/sample-tether.c
@@ -44,9 +44,9 @@ camera_tether(Camera *camera, GPContext *context) {
retval = gp_camera_file_get_info (camera, path->folder, path->name, &info, context);
printf (" info reported flags: %d\n", info.file.fields);
- printf (" info reported mtime: %ld\n", info.file.mtime);
- printf (" info reported size: %ld\n", info.file.size);
- printf (" info reported type: %s\n", info.file.type);
+ if (info.file.fields & GP_FILE_INFO_MTIME) printf (" info reported mtime: %ld\n", info.file.mtime);
+ if (info.file.fields & GP_FILE_INFO_SIZE) printf (" info reported size: %ld\n", info.file.size);
+ if (info.file.fields & GP_FILE_INFO_TYPE) printf (" info reported type: %s\n", info.file.type);
fd = open (path->name, O_CREAT | O_WRONLY | O_BINARY, 0644);
retval = gp_file_new_from_fd(&file, fd);