Fix OMAP pic handling of simultaneous interrupts.
[qemu] / block-raw.c
index 2b6f441..e9e5027 100644 (file)
@@ -914,8 +914,13 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
     s->hfile = CreateFile(filename, access_flags, 
                           FILE_SHARE_READ, NULL,
                           create_flags, overlapped, NULL);
-    if (s->hfile == INVALID_HANDLE_VALUE) 
+    if (s->hfile == INVALID_HANDLE_VALUE) {
+        int err = GetLastError();
+
+        if (err == ERROR_ACCESS_DENIED)
+            return -EACCES;
         return -1;
+    }
     return 0;
 }
 
@@ -1278,14 +1283,19 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
     s->hfile = CreateFile(filename, access_flags, 
                           FILE_SHARE_READ, NULL,
                           create_flags, overlapped, NULL);
-    if (s->hfile == INVALID_HANDLE_VALUE) 
+    if (s->hfile == INVALID_HANDLE_VALUE) {
+        int err = GetLastError();
+
+        if (err == ERROR_ACCESS_DENIED)
+            return -EACCES;
         return -1;
+    }
     return 0;
 }
 
 #if 0
 /***********************************************/
-/* removable device additionnal commands */
+/* removable device additional commands */
 
 static int raw_is_inserted(BlockDriverState *bs)
 {