Blame SOURCES/0002-Refactor-sbd-inquisitor-functionize-striping-leading.patch

f9195d
From 8438c244cc2066fbe9c598a6392e8935cf017d97 Mon Sep 17 00:00:00 2001
f9195d
From: "Gao,Yan" <ygao@suse.com>
f9195d
Date: Fri, 25 Jun 2021 15:02:14 +0200
f9195d
Subject: [PATCH] Refactor: sbd-inquisitor: functionize striping leading spaces
f9195d
 of an option value
f9195d
f9195d
---
f9195d
 src/sbd-inquisitor.c | 11 +++++++++--
f9195d
 1 file changed, 9 insertions(+), 2 deletions(-)
f9195d
f9195d
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
f9195d
index 4fec2fd..53ddfa3 100644
f9195d
--- a/src/sbd-inquisitor.c
f9195d
+++ b/src/sbd-inquisitor.c
f9195d
@@ -40,9 +40,8 @@ bool sync_resource_startup = false;
f9195d
 int parse_device_line(const char *line);
f9195d
 
f9195d
 static const char *
f9195d
-get_env_option(const char *option)
f9195d
+sanitize_option_value(const char *value)
f9195d
 {
f9195d
-	const char *value = getenv(option);
f9195d
 	size_t max = 0;
f9195d
 	size_t lpc = 0;
f9195d
 
f9195d
@@ -61,6 +60,14 @@ get_env_option(const char *option)
f9195d
 	return (strlen(value + lpc) > 0 ? (value + lpc) : NULL);
f9195d
 }
f9195d
 
f9195d
+static const char *
f9195d
+get_env_option(const char *option)
f9195d
+{
f9195d
+	const char *value = getenv(option);
f9195d
+
f9195d
+	return sanitize_option_value(value);
f9195d
+}
f9195d
+
f9195d
 static int
f9195d
 recruit_servant(const char *devname, pid_t pid)
f9195d
 {
f9195d
-- 
f9195d
1.8.3.1
f9195d