From 434814814bac0e116849684d0e257ebf9934d491 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 29 Feb 2012 14:14:08 +0100 Subject: [PATCH] * util/getroot.c [__APPLE__]: Add missing includes. (grub_util_biosdisk_is_floppy): Fix usage of undefined variable. --- ChangeLog | 5 +++++ util/getroot.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d96393950..95b00cddc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-29 Vladimir Serbinenko + + * util/getroot.c [__APPLE__]: Add missing includes. + (grub_util_biosdisk_is_floppy): Fix usage of undefined variable. + 2012-02-29 Vladimir Serbinenko * util/grub-mkimage.c (generate_image): Silence spurious warning. diff --git a/util/getroot.c b/util/getroot.c index 7bb547a35..499c0b5da 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -114,6 +114,9 @@ #if defined(__APPLE__) # include +# include +# include +# include #endif #ifdef HAVE_DEVICE_MAPPER @@ -1523,10 +1526,10 @@ grub_util_biosdisk_is_floppy (grub_disk_t disk) #else /* Some kernels (e.g. kFreeBSD) don't have a static major number for floppies, but they still use a "fd[0-9]" pathname. */ - if (map[disk->id].device[5] == 'f' - && map[disk->id].device[6] == 'd' - && map[disk->id].device[7] >= '0' - && map[disk->id].device[7] <= '9') + if (dname[5] == 'f' + && dname[6] == 'd' + && dname[7] >= '0' + && dname[7] <= '9') #endif return 1;