Wrong function and variable name cause a stupid compilation error on NetBSD
and OpenBSD. Only NetBSD and OpenBSD use this file. No other platform is
affected

Signed-off-by: Vladimir Serbinenko <phco...@gmail.com>
From abfb6d28342de26ce3e750f3a5a477221efcdc62 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phco...@gmail.com>
Date: Thu, 24 Aug 2023 21:48:20 +0200
Subject: [PATCH 06/14] bsd/hostdisk: Fix NetBSD compilation

Wrong function and variable name cause a stupid compilation error on NetBSD
and OpenBSD. Only NetBSD and OpenBSD use this file. No other platform is
affected

Signed-off-by: Vladimir Serbinenko <phco...@gmail.com>
---
 grub-core/osdep/bsd/hostdisk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/grub-core/osdep/bsd/hostdisk.c b/grub-core/osdep/bsd/hostdisk.c
index 891109462..1a7ea97b4 100644
--- a/grub-core/osdep/bsd/hostdisk.c
+++ b/grub-core/osdep/bsd/hostdisk.c
@@ -56,6 +56,10 @@
 # endif
 
 #if defined(__NetBSD__)
+# ifndef RAW_FLOPPY_MAJOR
+#  define RAW_FLOPPY_MAJOR	9
+# endif /* ! RAW_FLOPPY_MAJOR */
+
 /* Adjust device driver parameters.  This function should be called just
    after successfully opening the device.  For now, it simply prevents the
    floppy driver from retrying operations on failure, as otherwise the
@@ -92,7 +96,7 @@ grub_util_fd_open (const char *os_dev, int flags)
 
   ret = open (os_dev, flags, S_IROTH | S_IRGRP | S_IRUSR | S_IWUSR);
   if (ret >= 0)
-    configure_device_driver (fd);
+    configure_device_driver (ret);
   return ret;
 }
 
@@ -105,7 +109,7 @@ grub_util_get_fd_size_os (grub_util_fd_t fd, const char *name, unsigned *log_sec
   unsigned sector_size, log_sector_size;
 
 #if defined(__NetBSD__)
-  grub_hostdisk_configure_device_driver (fd);
+  configure_device_driver (fd);
 #endif
 
   if (ioctl (fd, DIOCGDINFO, &label) == -1)
-- 
2.39.2

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to