sweettea / rpms / btrfs-progs

Forked from rpms/btrfs-progs 9 months ago
Clone

Blame btrfs-progs-fix-return-value.patch

Josef Bacik cae92f
From 8b6be4c65eda396e0c42182f4ebf2794c62b442c Mon Sep 17 00:00:00 2001
Josef Bacik cae92f
From: Josef Bacik <josef@redhat.com>
Josef Bacik cae92f
Date: Tue, 2 Feb 2010 09:51:15 -0500
Josef Bacik cae92f
Subject: [PATCH] Btrfs-progs: make btrfsctl return values like everybody else
Josef Bacik cae92f
Josef Bacik cae92f
This patch makes btrfsctl return 0 for success and 1 for failure, which is the
Josef Bacik cae92f
behavior of all other userspace applications.  Thanks,
Josef Bacik cae92f
Josef Bacik cae92f
Signed-off-by: Josef Bacik <josef@redhat.com>
Josef Bacik cae92f
---
Josef Bacik cae92f
 btrfsctl.c |    6 ++----
Josef Bacik cae92f
 1 files changed, 2 insertions(+), 4 deletions(-)
Josef Bacik cae92f
Josef Bacik cae92f
diff --git a/btrfsctl.c b/btrfsctl.c
Josef Bacik cae92f
index 66c4e89..73d9c30 100644
Josef Bacik cae92f
--- a/btrfsctl.c
Josef Bacik cae92f
+++ b/btrfsctl.c
Josef Bacik cae92f
@@ -231,9 +231,7 @@ int main(int ac, char **av)
Josef Bacik cae92f
 		printf("ioctl failed with error %d\n", ret);
Josef Bacik cae92f
 	}
Josef Bacik cae92f
 	printf("%s\n", BTRFS_BUILD_VERSION);
Josef Bacik cae92f
-	if (ret)
Josef Bacik cae92f
-		exit(0);
Josef Bacik cae92f
-	else
Josef Bacik cae92f
-		exit(1);
Josef Bacik cae92f
+
Josef Bacik cae92f
+	return ret ? 1 : 0;
Josef Bacik cae92f
 }
Josef Bacik cae92f
 
Josef Bacik cae92f
-- 
Josef Bacik cae92f
1.6.6
Josef Bacik cae92f