Skip to contentSkip to conversation

master - cleanup: skip checking for just assigned string

PATCH Zdenek Kabelac 1 participant 1 message Nov 11, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e54cce245f2829107e1ed09221bca7ff7921d98b
Commit:        e54cce245f2829107e1ed09221bca7ff7921d98b
Parent:        59b29716e5fd0f490d28d2457cdebfc68eb9940e
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Oct 18 11:18:02 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Nov 11 16:52:24 2016 +0100

cleanup: skip checking for just assigned string

When 'stripe_filler' has been just set to 'error', do not check it again for not being 'error'.

---
 lib/commands/toolcontext.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
lib/commands/toolcontext.c +1 -2
index c416575..002af05 100644
@@ -640,8 +640,7 @@ static int _process_config(struct cmd_context *cmd)
 	if (!strcmp(cmd->stripe_filler, "/dev/ioerror") &&
 	    stat(cmd->stripe_filler, &st))
 		cmd->stripe_filler = "error";
-
-	if (strcmp(cmd->stripe_filler, "error")) {
+	else if (strcmp(cmd->stripe_filler, "error")) {
 		if (stat(cmd->stripe_filler, &st)) {
 			log_warn("WARNING: activation/missing_stripe_filler = \"%s\" "
 				 "is invalid,", cmd->stripe_filler);