* grub-core/kern/emu/hostdisk.c (grub_util_biosdisk_open): Move struct
stat immediately to where it's used.
This commit is contained in:
parent
5177ba1400
commit
bf645fda03
2 changed files with 12 additions and 6 deletions
|
@ -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>
|
2013-09-24 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* util/getroot.c (grub_util_check_block_device): Move to ...
|
* util/getroot.c (grub_util_check_block_device): Move to ...
|
||||||
|
|
|
@ -131,7 +131,6 @@ static grub_err_t
|
||||||
grub_util_biosdisk_open (const char *name, grub_disk_t disk)
|
grub_util_biosdisk_open (const char *name, grub_disk_t disk)
|
||||||
{
|
{
|
||||||
int drive;
|
int drive;
|
||||||
struct stat st;
|
|
||||||
struct grub_util_hostdisk_data *data;
|
struct grub_util_hostdisk_data *data;
|
||||||
|
|
||||||
drive = find_grub_drive (name);
|
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->log_sector_size);
|
||||||
disk->total_sectors >>= 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 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
|
# else
|
||||||
if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
|
if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode))
|
||||||
# endif
|
# endif
|
||||||
data->is_disk = 1;
|
data->is_disk = 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
grub_util_fd_close (fd);
|
grub_util_fd_close (fd);
|
||||||
|
|
Loading…
Reference in a new issue