summaryrefslogtreecommitdiffstats
path: root/sys-utils/rfkill.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys-utils/rfkill.c')
-rw-r--r--sys-utils/rfkill.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index e0671ffec..717506950 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -132,7 +132,11 @@ static const char *get_name(uint32_t idx)
return NULL;
}
- read(fd, name, sizeof(name) - 1);
+ if (read(fd, name, sizeof(name) - 1) < 0) {
+ warn(_("cannot read %s"), filename);
+ close(fd);
+ return NULL;
+ }
pos = strchr(name, '\n');
if (pos)