* util/getroot.c (grub_util_biosdisk_is_present): Don't do stat on
platforms on which it doesn't work.
This commit is contained in:
parent
bf645fda03
commit
e8fd80bc3d
2 changed files with 9 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-09-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* util/getroot.c (grub_util_biosdisk_is_present): Don't do stat on
|
||||
platforms on which it doesn't work.
|
||||
|
||||
2013-09-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Move struct
|
||||
|
|
|
@ -462,12 +462,16 @@ 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__)
|
||||
struct stat st;
|
||||
|
||||
if (stat (os_dev, &st) < 0)
|
||||
return 0;
|
||||
|
||||
int ret= (find_system_device (os_dev, &st, 1, 0) != NULL);
|
||||
#else
|
||||
int ret= (find_system_device (os_dev, NULL, 1, 0) != NULL);
|
||||
#endif
|
||||
grub_util_info ((ret ? "%s is present" : "%s is not present"),
|
||||
os_dev);
|
||||
return ret;
|
||||
|
|
Loading…
Reference in a new issue