]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* include/grub/emu/hostdisk.h (GRUB_FD_STAT_IS_FUNTIONAL): New define.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 24 Sep 2013 17:17:24 +0000 (19:17 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 24 Sep 2013 17:17:24 +0000 (19:17 +0200)
Migrate all explicit defines to this new one.

ChangeLog
grub-core/kern/emu/hostdisk.c
include/grub/emu/hostdisk.h
util/getroot.c

index ec4e1d67f8e1cc98686ffd20cdabf90cd5165fb6..fe5ad4021116117c6bf69efcd02f2a7223bb9064 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * include/grub/emu/hostdisk.h (GRUB_FD_STAT_IS_FUNTIONAL): New define.
+       Migrate all explicit defines to this new one.
+
 2013-09-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Use
index c1bd25619aa625cfda7e48970c95f75f03abc7bc..a29eb5f3ace2bf464099d1d1b391b29dfa273196 100644 (file)
@@ -161,7 +161,7 @@ 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__) && !defined (__AROS__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
     {
       struct stat st;
 # if GRUB_DISK_DEVS_ARE_CHAR
index ab438667a8e04e8e7db12f38e6b78cb30957166c..4d6b634215234034a86b8237c9de4cc5129fb6d9 100644 (file)
 typedef HANDLE grub_util_fd_t;
 #define GRUB_UTIL_FD_INVALID INVALID_HANDLE_VALUE
 #define GRUB_UTIL_FD_IS_VALID(x) ((x) != GRUB_UTIL_FD_INVALID)
+#define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 0
 #else
 typedef int grub_util_fd_t;
 #define GRUB_UTIL_FD_INVALID -1
 #define GRUB_UTIL_FD_IS_VALID(x) ((x) >= 0)
+#define GRUB_UTIL_FD_STAT_IS_FUNCTIONAL 1
 #endif
 
 grub_util_fd_t
index a165fdc0b7f13fef99aa39df6f72a3e54f00137c..9e852a681fed9a49d49ce6788d345aa949c3f8a4 100644 (file)
@@ -215,7 +215,7 @@ grub_util_get_os_disk (const char *os_dev)
 
   grub_util_info ("Looking for %s", os_dev);
 
-#if !defined (__MINGW32__) && !defined (__CYGWIN__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
   struct stat st;
 
   if (stat (os_dev, &st) < 0)
@@ -266,7 +266,7 @@ find_partition (grub_disk_t dsk __attribute__ ((unused)),
 char *
 grub_util_biosdisk_get_grub_dev (const char *os_dev)
 {
-#if !defined (__MINGW32__) && !defined (__CYGWIN__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
   struct stat st;
 #endif
   const char *drive;
@@ -275,7 +275,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
 
   grub_util_info ("Looking for %s", os_dev);
 
-#if !defined (__MINGW32__) && !defined (__CYGWIN__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
   if (stat (os_dev, &st) < 0)
     {
       const char *errstr = strerror (errno); 
@@ -415,7 +415,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
            grub_errno = GRUB_ERR_NONE;
 
            canon = canonicalize_file_name (os_dev);
-#if !defined (__MINGW32__) && !defined (__CYGWIN__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
            drive = find_system_device (canon ? : os_dev, &st, 0, 1);
 #else
            drive = find_system_device (canon ? : os_dev, NULL, 0, 1);
@@ -462,7 +462,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
 int
 grub_util_biosdisk_is_present (const char *os_dev)
 {
-#if !defined (__MINGW32__) && !defined (__CYGWIN__) && !defined (__AROS__)
+#if GRUB_UTIL_FD_STAT_IS_FUNCTIONAL
   struct stat st;
 
   if (stat (os_dev, &st) < 0)