mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
print only a partition type in print_fsys_type, don't call HDIO_GETGEO for a floppy in check_device.
This commit is contained in:
1 parent
a936d03921
commit
b9ff0c2f81
3 files changed
+18
-3
No files matched your search
+7
-2
@@ -43,6 +43,7 @@ int grub_stage2 (void);
|
||||
#ifdef __linux__
|
||||
# include <sys/ioctl.h> /* ioctl */
|
||||
# include <linux/hdreg.h> /* HDIO_GETGEO */
|
||||
# include <linux/major.h> /* FLOPPY_MAJOR */
|
||||
# if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))
|
||||
/* Maybe libc doesn't have large file support. */
|
||||
# include <linux/unistd.h> /* _llseek */
|
||||
@@ -526,8 +527,12 @@ check_device (const char *device)
|
||||
|
||||
if (fstat (fileno (fp), &st))
|
||||
return 0;
|
||||
|
||||
if (S_ISBLK (st.st_mode) && ioctl (fileno (fp), HDIO_GETGEO, &hdg))
|
||||
|
||||
/* If it is a block device and isn't a floppy, check if HDIO_GETGEO
|
||||
succeeds. */
|
||||
if (S_ISBLK (st.st_mode)
|
||||
&& MAJOR (st.st_rdev) != FLOPPY_MAJOR
|
||||
&& ioctl (fileno (fp), HDIO_GETGEO, &hdg))
|
||||
return 0;
|
||||
}
|
||||
#endif /* __linux__ */
|
||||
|
||||
Reference in new issue
Block a user