[lvm-devel] master - cleanup: reoder rstatus init

Zdenek Kabelac zkabelac at fedoraproject.org
Mon Nov 9 09:29:12 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=22e19cb354d813e4be9a461c16bf27205c86d71e
Commit:        22e19cb354d813e4be9a461c16bf27205c86d71e
Parent:        b1dab26be0ee7eec11a6e91ab715808ddf016355
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Sun Nov 8 17:18:23 2015 +0100
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Mon Nov 9 10:22:52 2015 +0100

cleanup: reoder rstatus init

In all error paths always initialize *rstatus.
---
 lib/misc/lvm-exec.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/misc/lvm-exec.c b/lib/misc/lvm-exec.c
index e414524..a3a629b 100644
--- a/lib/misc/lvm-exec.c
+++ b/lib/misc/lvm-exec.c
@@ -53,14 +53,14 @@ int exec_cmd(struct cmd_context *cmd, const char *const argv[],
 	int status;
 	char buf[PATH_MAX * 2];
 
+	if (rstatus)
+		*rstatus = -1;
+
 	if (!argv[0]) {
 		log_error(INTERNAL_ERROR "Missing command.");
 		return 0;
 	}
 
-	if (rstatus)
-		*rstatus = -1;
-
 	if (sync_needed)
 		/* Flush ops and reset dm cookie */
 		if (!sync_local_dev_names(cmd)) {




More information about the lvm-devel mailing list