]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/disk/arc/arcdisk.c (reopen): Close old handle before
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 21 May 2011 05:05:46 +0000 (07:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 21 May 2011 05:05:46 +0000 (07:05 +0200)
opening new one.

ChangeLog
grub-core/disk/arc/arcdisk.c

index a01d57576e33a82590c76a16237a8574b5088bec..198750f6acf73fdf58273d58b1419597212e7478 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-21  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/disk/arc/arcdisk.c (reopen): Close old handle before
+       opening new one.
+
 2011-05-21  Colin Watson  <cjwatson@ubuntu.com>
 2011-05-21  Vladimir Serbinenko  <phcoder@gmail.com>
 
index e8416634a33588655569d378b4457e100377cdf0..7dff309318b3bb9a33a2a1867598e459d3fb9e81 100644 (file)
@@ -1,7 +1,7 @@
 /* ofdisk.c - Open Firmware disk access.  */
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2004,2006,2007,2008,2009  Free Software Foundation, Inc.
+ *  Copyright (C) 2004,2006,2007,2008,2009,2011  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -105,11 +105,6 @@ reopen (const char *name)
       grub_dprintf ("arcdisk", "using already opened %s\n", name);
       return GRUB_ERR_NONE;
     }
-  if (GRUB_ARC_FIRMWARE_VECTOR->open (name, 0, &handle))
-    {
-      grub_dprintf ("arcdisk", "couldn't open %s\n", name);
-      return grub_error (GRUB_ERR_IO, "couldn't open %s", name);
-    }
   if (last_path)
     {
       GRUB_ARC_FIRMWARE_VECTOR->close (last_handle);
@@ -117,6 +112,11 @@ reopen (const char *name)
       last_path = NULL;
       last_handle = 0;
     }
+  if (GRUB_ARC_FIRMWARE_VECTOR->open (name, 0, &handle))
+    {
+      grub_dprintf ("arcdisk", "couldn't open %s\n", name);
+      return grub_error (GRUB_ERR_IO, "couldn't open %s", name);
+    }
   last_path = grub_strdup (name);
   if (!last_path)
     return grub_errno;