diff --git a/cmds-replace.c b/cmds-replace.c index d14c9b57..9397396c 100644 --- a/cmds-replace.c +++ b/cmds-replace.c @@ -235,7 +235,7 @@ static int cmd_start_replace(int argc, char **argv) } } else { fdsrcdev = open(srcdev, O_RDWR); - if (!fdsrcdev) { + if (fdsrcdev < 0) { fprintf(stderr, "Error: Unable to open device '%s'\n", srcdev); goto leave_with_error;