From 13d4dd7f03e7b08a0385b6fb361a6814ecef19b5 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 30 Mar 2012 13:16:20 +0200 Subject: [PATCH] Adds more error conversion from Windows to errno. Also prints the error if the conversion is no supported. --- HISTORY | 4 ++-- mingw.c | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 9ff4adf5..4007f02e 100644 --- a/HISTORY +++ b/HISTORY @@ -2,7 +2,7 @@ SnapRAID HISTORY ================ 1.9 2012/3 -=========== +========== * Implemented a more sophisticated recovering in case a harddisk failure happens during a 'sync' command. When using RAID6 it improves the chances of recovering data after an @@ -13,7 +13,7 @@ SnapRAID HISTORY * In Windows ensures that the disk serial number is not zero. 1.8 2012/1 -=========== +========== * Added a new "dup" command to find all the duplicate files. * Added a new option "--filter-nohidden" to exclude hidden files. * Faster and parallel writing of content files. diff --git a/mingw.c b/mingw.c index b6048eba..95639424 100644 --- a/mingw.c +++ b/mingw.c @@ -208,7 +208,14 @@ static void windows_errno(DWORD error) case ERROR_ACCESS_DENIED : errno = EACCES; break; + case ERROR_BUFFER_OVERFLOW : + errno = ENAMETOOLONG; + break; + case ERROR_NOT_ENOUGH_MEMORY : + errno = ENOMEM; + break; default: + fprintf(stderr, "Unexpected Windows error %d.\n", error); errno = EIO; break; }