dryang / rpms / systemd

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