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; }