From 7c17daad175a9e8bd876c3c548db0bdd4449b895 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Tue, 26 Oct 2021 16:27:22 +0000 Subject: [PATCH] prepare-root: get rid of a global variable This moves a global mutable variable to a smaller local scope, as it is not really used outside of that. --- src/switchroot/ostree-prepare-root.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 20b8685d..46283f3f 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -81,9 +81,6 @@ #include "ostree-mount-util.h" -/* Initialized early in main */ -static bool running_as_pid1; - static inline bool sysroot_is_configured_ro (const char *sysroot) { @@ -175,7 +172,7 @@ main(int argc, char *argv[]) * - Quiet logging as there's no journal * etc. */ - running_as_pid1 = (getpid () == 1); + bool running_as_pid1 = (getpid () == 1); const char *root_arg = NULL; bool we_mounted_proc = false;