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>
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;
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;