diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2013-06-30 11:13:27 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2013-06-30 11:13:27 +0000 |
commit | 402a72462738a4bda3c106b82390188014438fb0 (patch) | |
tree | 2844c2446e339299e716c82d90d8a6f8abb5744c /camlibs/ptp2/ptpip.c | |
parent | edafe18ae33648f3fdcca771865a8bad828d16b9 (diff) | |
download | libgphoto2-402a72462738a4bda3c106b82390188014438fb0.tar.gz |
handle return values from select
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14478 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/ptp2/ptpip.c')
-rw-r--r-- | camlibs/ptp2/ptpip.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/camlibs/ptp2/ptpip.c b/camlibs/ptp2/ptpip.c index b5300b9b7..0d2ee602a 100644 --- a/camlibs/ptp2/ptpip.c +++ b/camlibs/ptp2/ptpip.c @@ -544,8 +544,14 @@ ptp_ptpip_event (PTPParams* params, PTPContainer* event, int wait) else timeout.tv_usec = 1000; /* 1/1000 second .. perhaps wait longer? */ - if (1 != select (params->evtfd+1, &infds, NULL, NULL, &timeout)) - return PTP_RC_OK; + ret = select (params->evtfd+1, &infds, NULL, NULL, &timeout); + if (1 != ret) { + if (-1 == ret) { + gp_log (GP_LOG_DEBUG,"ptpip/event", "select returned error, errno is %d", errno); + return PTP_ERROR_IO; + } + return PTP_ERROR_TIMEOUT; + } ret = ptp_ptpip_evt_read (params, &hdr, &data); if (ret != PTP_RC_OK) |