summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-06 15:20:29 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-06 15:20:29 +0100
commit4a3ad39957399c4a30fc472a804e72907ecaa4f9 (patch)
tree5812cfeac1378c69db3044101af5f340790b5a46 /src
parent25fa306ed58b0b7fe30ca9be37c66a7b3b2de70e (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/systemctl/systemctl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 8a3e203e9e..d9e9c2a6c3 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -7001,8 +7001,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) {