summaryrefslogtreecommitdiff
path: root/cmds-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmds-device.c')
-rw-r--r--cmds-device.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmds-device.c b/cmds-device.c
index d4938f4e..7a0f7a40 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -87,9 +87,8 @@ static int cmd_add_dev(int argc, char **argv)
}
devfd = open(argv[i], O_RDWR);
- if (!devfd) {
+ if (devfd < 0) {
fprintf(stderr, "ERROR: Unable to open device '%s'\n", argv[i]);
- close(devfd);
ret++;
continue;
}