Btrfs-progs: fix magic return value in cmds-receive.c
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>
Wed, 4 Sep 2013 15:22:27 +0000 (23:22 +0800)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:20:41 +0000 (08:20 -0400)
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
cmds-receive.c

index 1630f64..2b880c0 100644 (file)
@@ -951,13 +951,13 @@ int cmd_receive(int argc, char **argv)
                receive_fd = open(fromfile, O_RDONLY | O_NOATIME);
                if (receive_fd < 0) {
                        fprintf(stderr, "ERROR: failed to open %s\n", fromfile);
-                       return -errno;
+                       return 1;
                }
        }
 
        ret = do_receive(&r, tomnt, receive_fd);
 
-       return ret;
+       return !!ret;
 }
 
 const char * const cmd_receive_usage[] = {