From 30bf43e086bee84876fee781a9d770dbf573d8a3 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Thu, 20 Aug 2015 08:48:50 +0200 Subject: [PATCH] errors on ptp_canon_setobjectarchive are not fatal. S5 reports invalid object handle --- camlibs/ptp2/library.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 1cd361ab8..031ff8c9b 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -5836,8 +5836,10 @@ read_file_func (CameraFilesystem *fs, const char *folder, const char *filename, ptp_operation_issupported(params,PTP_OC_CANON_SetObjectArchive) ) { /* 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;