cca0c4
From 7b34b49d2a08a2636e0319b94d72ab654a30343d Mon Sep 17 00:00:00 2001
cca0c4
From: Robert Marshall <rmarshall@redhat.com>
cca0c4
Date: Thu, 8 Dec 2016 13:39:22 -0500
cca0c4
Subject: [PATCH 30/55] Rename setDefaultImage variables
cca0c4
cca0c4
The variable names in setDefaultImage did not match well with
cca0c4
how they were being used inside the function. Refactored the
cca0c4
variable names as a precursor to refactoring the function.
cca0c4
cca0c4
Related: rhbz#1285601
cca0c4
---
cca0c4
 grubby.c | 18 +++++++++---------
cca0c4
 1 file changed, 9 insertions(+), 9 deletions(-)
cca0c4
cca0c4
diff --git a/grubby.c b/grubby.c
cca0c4
index e2384c55898..9af8d17b345 100644
cca0c4
--- a/grubby.c
cca0c4
+++ b/grubby.c
cca0c4
@@ -2491,19 +2491,19 @@ void markRemovedImage(struct grubConfig *cfg, const char *image,
cca0c4
 		entry->skip = 1;
cca0c4
 }
cca0c4
 
cca0c4
-void setDefaultImage(struct grubConfig *config, int hasNew,
cca0c4
-		     const char *defaultKernelPath, int newIsDefault,
cca0c4
-		     const char *prefix, int flags, int index)
cca0c4
+void setDefaultImage(struct grubConfig *config, int isUserSpecifiedKernelPath,
cca0c4
+		     const char *defaultKernelPath, int newBootEntryIsDefault,
cca0c4
+		     const char *prefix, int flags, int newDefaultBootEntryIndex)
cca0c4
 {
cca0c4
 	struct singleEntry *entry, *entry2, *newDefault;
cca0c4
 	int i, j;
cca0c4
 
cca0c4
-	if (newIsDefault) {
cca0c4
+	if (newBootEntryIsDefault) {
cca0c4
 		config->defaultImage = 0;
cca0c4
 		return;
cca0c4
-	} else if ((index >= 0) && config->cfi->defaultIsIndex) {
cca0c4
-		if (findEntryByIndex(config, index))
cca0c4
-			config->defaultImage = index;
cca0c4
+	} else if ((newDefaultBootEntryIndex >= 0) && config->cfi->defaultIsIndex) {
cca0c4
+		if (findEntryByIndex(config, newDefaultBootEntryIndex))
cca0c4
+			config->defaultImage = newDefaultBootEntryIndex;
cca0c4
 		else
cca0c4
 			config->defaultImage = -1;
cca0c4
 		return;
cca0c4
@@ -2531,7 +2531,7 @@ void setDefaultImage(struct grubConfig *config, int hasNew,
cca0c4
 
cca0c4
 	if (entry && !entry->skip) {
cca0c4
 		/* we can preserve the default */
cca0c4
-		if (hasNew)
cca0c4
+		if (isUserSpecifiedKernelPath)
cca0c4
 			config->defaultImage++;
cca0c4
 
cca0c4
 		/* count the number of entries erased before this one */
cca0c4
@@ -2540,7 +2540,7 @@ void setDefaultImage(struct grubConfig *config, int hasNew,
cca0c4
 			if (entry2->skip)
cca0c4
 				config->defaultImage--;
cca0c4
 		}
cca0c4
-	} else if (hasNew) {
cca0c4
+	} else if (isUserSpecifiedKernelPath) {
cca0c4
 		config->defaultImage = 0;
cca0c4
 	} else {
cca0c4
 		/* Either we just erased the default (or the default line was
cca0c4
-- 
cca0c4
2.17.1
cca0c4