Move stat () and device mode checking into OS-dependent files as

long as performance doesn't suffer.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-10-19 16:29:20 +02:00
parent a4012f0764
commit cd78a56fb2
10 changed files with 93 additions and 71 deletions

View file

@ -72,6 +72,13 @@ grub_util_device_is_mapped (const char *dev)
if (stat (dev, &st) < 0)
return 0;
#if GRUB_DISK_DEVS_ARE_CHAR
if (! S_ISCHR (st.st_mode))
#else
if (! S_ISBLK (st.st_mode))
#endif
return 0;
return dm_is_dm_major (major (st.st_rdev));
}