diff options
Diffstat (limited to 'misc-utils/lsblk.c')
-rw-r--r-- | misc-utils/lsblk.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/misc-utils/lsblk.c b/misc-utils/lsblk.c index 30d5d9b4e..2ad2a4339 100644 --- a/misc-utils/lsblk.c +++ b/misc-utils/lsblk.c @@ -655,8 +655,9 @@ static char *get_vfs_attribute(struct lsblk_device *dev, int id) static struct stat *device_get_stat(struct lsblk_device *dev) { - if (!dev->st.st_rdev) - stat(dev->filename, &dev->st); + if (!dev->st.st_rdev + && stat(dev->filename, &dev->st) != 0) + return NULL; return &dev->st; } |