[PATCH 04/20] Btrfs-progs: fix magic return value in cmds-dedup.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx>

Signed-off-by: Wang Shilong <wangsl.fnst@xxxxxxxxxxxxxx>
---
 cmds-dedup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmds-dedup.c b/cmds-dedup.c
index eb43414..674952a 100644
--- a/cmds-dedup.c
+++ b/cmds-dedup.c
@@ -39,7 +39,7 @@ int dedup_ctl(int cmd, int argc, char **argv)
 	DIR *dirstream;
 
 	if (check_argc_exact(argc, 2))
-		return -1;
+		return -EINVAL;
 
 	fd = open_file_or_dir(path, &dirstream);
 	if (fd < 0) {
@@ -71,7 +71,7 @@ static int cmd_dedup_enable(int argc, char **argv)
 	int ret = dedup_ctl(BTRFS_DEDUP_CTL_REG, argc, argv);
 	if (ret < 0)
 		usage(cmd_dedup_enable_usage);
-	return ret;
+	return !!ret;
 }
 
 static const char * const cmd_dedup_disable_usage[] = {
@@ -85,7 +85,7 @@ static int cmd_dedup_disable(int argc, char **argv)
 	int ret = dedup_ctl(BTRFS_DEDUP_CTL_UNREG, argc, argv);
 	if (ret < 0)
 		usage(cmd_dedup_disable_usage);
-	return ret;
+	return !!ret;
 }
 
 const struct cmd_group dedup_cmd_group = {
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux