From 08574c43d314cf9ac189e2d2c6467bca6ed9e97e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Mon, 30 Jun 2008 19:01:51 +0000 Subject: When scanning for Ipod / Sansa close the disc handle of every tried disc, not only for successful checks. Fixes "no Sansa found" issues with rbutil on w32 after autodetection was used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17893 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/ipodpatcher/ipodpatcher.c | 5 +++++ rbutil/sansapatcher/sansapatcher.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/rbutil/ipodpatcher/ipodpatcher.c b/rbutil/ipodpatcher/ipodpatcher.c index 2177320f2a..73467dea34 100644 --- a/rbutil/ipodpatcher/ipodpatcher.c +++ b/rbutil/ipodpatcher/ipodpatcher.c @@ -1292,23 +1292,28 @@ int ipod_scan(struct ipod_t* ipod) if(result == -2) { denied++; } + ipod_close(ipod); continue; } if (read_partinfo(ipod,1) < 0) { + ipod_close(ipod); continue; } if ((ipod->pinfo[0].start==0) || (ipod->pinfo[0].type != 0)) { + ipod_close(ipod); continue; } if (read_directory(ipod) < 0) { + ipod_close(ipod); continue; } ipod_version=(ipod->ipod_directory[0].vers>>8); if (getmodel(ipod,ipod_version) < 0) { + ipod_close(ipod); continue; } diff --git a/rbutil/sansapatcher/sansapatcher.c b/rbutil/sansapatcher/sansapatcher.c index 30433e282e..82a87bf46e 100644 --- a/rbutil/sansapatcher/sansapatcher.c +++ b/rbutil/sansapatcher/sansapatcher.c @@ -514,15 +514,18 @@ int sansa_scan(struct sansa_t* sansa) if(result == -2) { denied++; } + sansa_close(sansa); continue; } if (sansa_read_partinfo(sansa,1) < 0) { + sansa_close(sansa); continue; } if (is_sansa(sansa) < 0) { continue; + sansa_close(sansa); } #ifdef __WIN32__ -- cgit v1.2.3