From dc8cbddac49b7cfc0ad8eaee1f2a367c833a8cca Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 2 Oct 2021 13:26:40 +0200 Subject: [PATCH] report only if flag set --- examples/sample-tether.c | 6 +++--- 1 file 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);