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

@ -57,6 +57,13 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
int *is_part)
{
char *path = xstrdup (os_dev);
if (! S_ISCHR (st->st_mode))
{
*is_part = 0;
return path;
}
if (strncmp ("/dev/", path, 5) == 0)
{
char *p;