mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-23 22:53:35 +00:00
btrfs-progs: fix open error test in cmd_start_replace
open() returns a negative fd on failure, not 0. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
This commit is contained in:
parent
bbf1919b00
commit
67c631329a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user