summaryrefslogtreecommitdiff
path: root/cmd_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd_device.c')
-rw-r--r--cmd_device.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/cmd_device.c b/cmd_device.c
index 1c5208af..505fedc4 100644
--- a/cmd_device.c
+++ b/cmd_device.c
@@ -121,10 +121,7 @@ int cmd_device_show(int argc, char *argv[])
char *dev_name = basename(dirname(link));
- int fd = openat(dirfd(fs.sysfs), entry->d_name, O_RDONLY);
- if (fd < 0)
- die("couldn't open device %s: %s\n",
- entry->d_name, strerror(errno));
+ int fd = xopenat(dirfd(fs.sysfs), entry->d_name, O_RDONLY);
devices[nr_devices] = fill_dev(strdup(dev_name), nr, fd);
tiers[devices[nr_devices].tier]++;