From 67c631329a0207476f9342843601b1ad633687f7 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Mon, 25 Feb 2013 16:54:39 -0600 Subject: [PATCH] btrfs-progs: fix open error test in cmd_start_replace open() returns a negative fd on failure, not 0. Signed-off-by: Eric Sandeen --- cmds-replace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;