From 53f7aab136a56d435fb01e85ffcd0b8e59f3eaf7 Mon Sep 17 00:00:00 2001 From: dimok789 <15055714+dimok789@users.noreply.github.com> Date: Sat, 21 Apr 2012 21:02:36 +0000 Subject: [PATCH] Forwarder: - fixed endless waiting for slow HDD (now really 10 secs timeout) - added missing ext2 unmount Thanks to FIX94 for pointing at those two bugs. --- source/devicemounter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/devicemounter.c b/source/devicemounter.c index 82be74bc..8c780fd8 100644 --- a/source/devicemounter.c +++ b/source/devicemounter.c @@ -45,7 +45,7 @@ int USBDevice_Init() { time_t start = time(0); - while(start-time(0) < 10) // 10 sec + while(time(0)-start < 10) // 10 sec { if(__io_usbstorage.startup() && __io_usbstorage.isInserted()) break; @@ -104,6 +104,7 @@ void USBDevice_deInit() { sprintf(Name, "%s:/", DeviceName[dev]); fatUnmount(Name); + ext2Unmount(Name); ntfsUnmount(Name, true); } //Let's not shutdown so it stays awake for the application