]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostdisk.c (open_device): Set data->fd to -1 if
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 9 May 2011 16:48:50 +0000 (18:48 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Mon, 9 May 2011 16:48:50 +0000 (18:48 +0200)
openning fails.
Reported by: Mark Korenberg.

ChangeLog
grub-core/kern/emu/hostdisk.c

index 532a3a3b8e135f04941afe7c1b8a6febe0abb93a..7c924a505bec074ddc3ac93983c90cc5a614ecbc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-05-09  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostdisk.c (open_device): Set data->fd to -1 if
+       openning fails.
+       Reported by: Mark Korenberg.
+
 2011-05-09  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/emu/hostdisk.c (linux_find_partition): Prevent possible
index 085048e8665cea56306fdb2207035a1d154e96dd..92882838fb7e99f2176f35f039062b20f6de39c5 100644 (file)
@@ -678,6 +678,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
              }
 
            close (data->fd);
+           data->fd = -1;
          }
 
        /* Open the partition.  */
@@ -736,6 +737,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags)
 #endif
              }
            close (data->fd);
+           data->fd = -1;
        }
 
       fd = open (map[disk->id].device, flags);