projects
/
platform
/
upstream
/
btrfs-progs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbf1919
)
btrfs-progs: fix open error test in cmd_start_replace
author
Eric Sandeen
<sandeen@redhat.com>
Mon, 25 Feb 2013 22:54:39 +0000
(16:54 -0600)
committer
David Sterba
<dsterba@suse.cz>
Wed, 27 Feb 2013 13:39:34 +0000
(14:39 +0100)
open() returns a negative fd on failure, not 0.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
cmds-replace.c
patch
|
blob
|
history
diff --git
a/cmds-replace.c
b/cmds-replace.c
index
d14c9b5
..
9397396
100644
(file)
--- 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;