naccyde / rpms / systemd

Forked from rpms/systemd a year ago
Clone
c62b8e
From 25112918d6b54fc1136dde2eef24d6c2d33e55b3 Mon Sep 17 00:00:00 2001
c62b8e
From: Lukas Nykryn <lnykryn@redhat.com>
c62b8e
Date: Thu, 28 Mar 2019 15:24:58 +0100
c62b8e
Subject: [PATCH] shutdown: in_container was used before its definition
c62b8e
c62b8e
RHEL-only
c62b8e
Resolves: #1693716
c62b8e
---
c62b8e
 src/core/shutdown.c | 4 ++--
c62b8e
 1 file changed, 2 insertions(+), 2 deletions(-)
c62b8e
c62b8e
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
c62b8e
index 0b0a54a7de..eff1cf2d59 100644
c62b8e
--- a/src/core/shutdown.c
c62b8e
+++ b/src/core/shutdown.c
c62b8e
@@ -296,6 +296,8 @@ int main(int argc, char *argv[]) {
c62b8e
 
c62b8e
         cg_get_root_path(&cgroup);
c62b8e
 
c62b8e
+        in_container = detect_container(NULL) > 0;
c62b8e
+
c62b8e
         use_watchdog = !!getenv("WATCHDOG_USEC");
c62b8e
 
c62b8e
         /* lock us into memory */
c62b8e
@@ -314,8 +316,6 @@ int main(int argc, char *argv[]) {
c62b8e
         log_info("Sending SIGKILL to remaining processes...");
c62b8e
         broadcast_signal(SIGKILL, true, false);
c62b8e
 
c62b8e
-        in_container = detect_container(NULL) > 0;
c62b8e
-
c62b8e
         need_umount = !in_container;
c62b8e
         need_swapoff = !in_container;
c62b8e
         need_loop_detach = !in_container;