Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > 3dd8bca5a331f46a5ba1cbec6d91c01d > files > 11

systemd-217-11.2.mga5.src.rpm

From eebb8b484f32e6b427a689eae7ed01f4b2c3dc95 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 6 Nov 2014 15:20:29 +0100
Subject: [PATCH 110/115] systemctl: when invokes as "reboot -f", sync()

We do this in the clean shutdown path in shutdown.c, hence we should do
is for "reboot -f", too.

(cherry picked from commit 4a3ad39957399c4a30fc472a804e72907ecaa4f9)
---
 src/systemctl/systemctl.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 28eaa6a..d6ca606 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -6917,8 +6917,13 @@ done:
 
 static int halt_now(enum action a) {
 
-/* Make sure C-A-D is handled by the kernel from this
-         * point on... */
+        /* The kernel will automaticall flush ATA disks and suchlike
+         * on reboot(), but the file systems need to be synce'd
+         * explicitly in advance. */
+        sync();
+
+        /* Make sure C-A-D is handled by the kernel from this point
+         * on... */
         reboot(RB_ENABLE_CAD);
 
         switch (a) {
-- 
2.2.2