]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Move struct
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 24 Sep 2013 16:57:19 +0000 (18:57 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 24 Sep 2013 16:57:19 +0000 (18:57 +0200)
stat immediately to where it's used.

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

index 7777c5619076db583e35ece9983716891bae8723..2480a9d302bb977eb07b1fb985529f9a6da21cc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Move struct
+       stat immediately to where it's used.
+
 2013-09-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * util/getroot.c (grub_util_check_block_device): Move to ...
index 260362fa8617e3274c6a970b6a07c1e9dda5be32..60e9344d18d0fac2b586db2724d3c4f79585d3b3 100644 (file)
@@ -131,7 +131,6 @@ static grub_err_t
 grub_util_biosdisk_open (const char *name, grub_disk_t disk)
 {
   int drive;
-  struct stat st;
   struct grub_util_hostdisk_data *data;
 
   drive = find_grub_drive (name);
@@ -162,14 +161,16 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk)
                                                 &disk->log_sector_size);
     disk->total_sectors >>= disk->log_sector_size;
 
-#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-
+#if !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined (__AROS__)
+    {
+      struct stat st;
 # if GRUB_DISK_DEVS_ARE_CHAR
-    if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode))
+      if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode))
 # else
-    if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
+      if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
 # endif
-      data->is_disk = 1;
+       data->is_disk = 1;
+    }
 #endif
 
     grub_util_fd_close (fd);