libblkid: don't probe directories
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
7c97f7402e
commit
26eb5a59fc
|
@ -626,6 +626,9 @@ int blkid_probe_set_device(blkid_probe pr, int fd,
|
|||
if (fstat(fd, &sb))
|
||||
goto err;
|
||||
|
||||
if (!S_ISBLK(sb.st_mode) && !S_ISCHR(sb.st_mode) && !S_ISREG(sb.st_mode))
|
||||
goto err;
|
||||
|
||||
pr->mode = sb.st_mode;
|
||||
if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode))
|
||||
pr->devno = sb.st_rdev;
|
||||
|
|
Loading…
Reference in New Issue