From f635d32e00abc067acc10ede6610732a004a3b5f Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Thu, 27 Jul 2017 11:15:07 -0400 Subject: [PATCH] don't remap errors > ELAST to EIO (should display via number w/o name) --- src/remap_os_error.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/remap_os_error.c b/src/remap_os_error.c index 85f991e..77d6a90 100644 --- a/src/remap_os_error.c +++ b/src/remap_os_error.c @@ -10,7 +10,11 @@ int remap_os_error(unsigned long e) { switch(e) { case NO_ERROR: return 0; - default: return EIO; + default: + #ifdef ELAST + if (e > ELAST) return e; + #endif + return EIO; case ERROR_INVALID_HANDLE: return EBADF; @@ -24,7 +28,6 @@ int remap_os_error(unsigned long e) { case ERROR_WRITE_FAULT: return EIO; - case ERROR_ACCESS_DENIED: case ERROR_CANNOT_MAKE: case ERROR_CURRENT_DIRECTORY: