Fixed file errno mapping.
authorArmin Novak <armin.novak@thincast.com>
Mon, 24 Jul 2017 13:05:48 +0000 (15:05 +0200)
committerArmin Novak <armin.novak@thincast.com>
Mon, 24 Jul 2017 13:05:48 +0000 (15:05 +0200)
channels/drive/client/drive_main.c
winpr/libwinpr/file/file.c

index ce3d246..c056cc8 100644 (file)
@@ -91,6 +91,14 @@ static DWORD drive_map_windows_err(DWORD fs_errno)
                        rc = STATUS_DEVICE_BUSY;
                        break;
 
+               case ERROR_INVALID_DRIVE:
+                       rc = STATUS_NO_SUCH_DEVICE;
+                       break;
+
+               case ERROR_NOT_READY:
+                       rc = STATUS_NO_SUCH_DEVICE;
+               break;
+
                case ERROR_FILE_EXISTS:
                case ERROR_ALREADY_EXISTS:
                        rc  = STATUS_OBJECT_NAME_COLLISION;
@@ -118,7 +126,7 @@ static DWORD drive_map_windows_err(DWORD fs_errno)
 
                default:
                        rc = STATUS_UNSUCCESSFUL;
-                       WLog_ERR(TAG, "Error code not found: %"PRId32"", fs_errno);
+                       WLog_ERR(TAG, "Error code not found: %"PRIu32"", fs_errno);
                        break;
        }
 
index f629056..236d303 100644 (file)
@@ -561,6 +561,12 @@ UINT32 map_posix_err(int fs_errno)
                        rc = STATUS_SUCCESS;
                        break;
 
+               case ENODEV:
+               case ENOTDIR:
+               case ENXIO:
+                       rc = ERROR_FILE_NOT_FOUND;
+                       break;
+
                case EPERM:
                case EACCES:
                        rc = ERROR_ACCESS_DENIED;