summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-09-11 16:29:25 -0600
committerJens Axboe <axboe@kernel.dk>2018-09-11 16:29:25 -0600
commit749dff992a915224e50ac56065a664380632ed52 (patch)
treec03a5691c7a183c8c8dea7ffba1e73f2bf57adfa /os
parentbf74b27eed661a967a700869cc3ec1046b46d8a7 (diff)
downloadfio-749dff992a915224e50ac56065a664380632ed52.tar.gz
fio-749dff992a915224e50ac56065a664380632ed52.tar.bz2
windows: handle ERROR_NOT_READY
The windows-to-posix error translation doesn't include ERROR_NOT_READY, add that. Also add a default case that catches if we don't know what an error is, and return EIO. That seems much safer than just returning the Windows error directly, since the caller expects an errno. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'os')
-rw-r--r--os/windows/posix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/os/windows/posix.c b/os/windows/posix.c
index d33250de..3285ce58 100644
--- a/os/windows/posix.c
+++ b/os/windows/posix.c
@@ -55,6 +55,7 @@ int win_to_posix_error(DWORD winerr)
case ERROR_NOT_SAME_DEVICE: return EXDEV;
case ERROR_WRITE_PROTECT: return EROFS;
case ERROR_BAD_UNIT: return ENODEV;
+ case ERROR_NOT_READY: return EAGAIN;
case ERROR_SHARING_VIOLATION: return EACCES;
case ERROR_LOCK_VIOLATION: return EACCES;
case ERROR_SHARING_BUFFER_EXCEEDED: return ENOLCK;
@@ -110,6 +111,9 @@ int win_to_posix_error(DWORD winerr)
case ERROR_DISK_FULL: return ENOSPC;
case ERROR_NOACCESS: return EFAULT;
case ERROR_FILE_INVALID: return ENXIO;
+ default:
+ log_err("fio: windows error %d not handled\n", winerr);
+ return EIO;
}
return winerr;