diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2016-01-09 11:26:50 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2016-01-09 11:26:50 +0100 |
commit | a1abab8fd46920084384d40f34836a35d17b285b (patch) | |
tree | bbc725c687fa0483a625d8eef673047ae6957c84 | |
parent | b058bdc3a54432040386d9fcc8d7ebf1a345576e (diff) | |
download | libgphoto2-a1abab8fd46920084384d40f34836a35d17b285b.tar.gz |
ignore errors from canon_setobjectarchived, it fails
on older Canon Powershots occasionaly.
Fixes https://github.com/gphoto/libgphoto2/issues/34
-rw-r--r-- | camlibs/ptp2/library.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 036e0808e..0164936f3 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -6207,9 +6207,13 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, (ob->canon_flags & 0x20) && ptp_operation_issupported(params,PTP_OC_CANON_SetObjectArchive) ) { + uint16_t ret; + /* seems just a byte (0x20 - new) */ - C_PTP_REP (ptp_canon_setobjectarchive (params, oid, ob->canon_flags &~0x20)); - ob->canon_flags &= ~0x20; + /* can fail on some models, like S5. Ignore errors. */ + ret = LOG_ON_PTP_E (ptp_canon_setobjectarchive (params, oid, ob->canon_flags & ~0x20)); + if (ret == PTP_RC_OK) + ob->canon_flags &= ~0x20; } break; } |