mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-24 07:02:45 +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 {
|
} else {
|
||||||
fdsrcdev = open(srcdev, O_RDWR);
|
fdsrcdev = open(srcdev, O_RDWR);
|
||||||
if (!fdsrcdev) {
|
if (fdsrcdev < 0) {
|
||||||
fprintf(stderr, "Error: Unable to open device '%s'\n",
|
fprintf(stderr, "Error: Unable to open device '%s'\n",
|
||||||
srcdev);
|
srcdev);
|
||||||
goto leave_with_error;
|
goto leave_with_error;
|
||||||
|
Loading…
Reference in New Issue
Block a user