summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca BRUNO <luca.bruno@coreos.com>2021-10-26 16:27:22 +0000
committerLuca BRUNO <luca.bruno@coreos.com>2021-10-26 16:27:22 +0000
commit7c17daad175a9e8bd876c3c548db0bdd4449b895 (patch)
tree174d53e3d35a9c60d532acdbb5191ea00436e31f
parent1e6077af03a130d3f2c3d7e56e5b8f36c563b46e (diff)
downloadostree-7c17daad175a9e8bd876c3c548db0bdd4449b895.tar.gz
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.
-rw-r--r--src/switchroot/ostree-prepare-root.c5
1 files changed, 1 insertions, 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;