[gnome-software/1874-restart-update-no-longer-asks-for-confirmation] gs-common: Call sync() before invoking Reboot
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/1874-restart-update-no-longer-asks-for-confirmation] gs-common: Call sync() before invoking Reboot
- Date: Thu, 1 Sep 2022 09:09:44 +0000 (UTC)
commit cd065dcd100cadc6216eb38b0a235e0bd9d16ee2
Author: Milan Crha <mcrha redhat com>
Date: Thu Sep 1 09:35:18 2022 +0200
gs-common: Call sync() before invoking Reboot
Make sure file buffers are written to the disk before invoking Reboot.
src/gs-common.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/gs-common.c b/src/gs-common.c
index f9fbffd95..2263a043a 100644
--- a/src/gs-common.c
+++ b/src/gs-common.c
@@ -949,6 +949,9 @@ gs_utils_invoke_reboot_ready2_got_session_bus_cb (GObject *source_object,
cancellable = g_task_get_cancellable (task);
+ /* Make sure file buffers are written to the disk before invoking reboot */
+ sync ();
+
g_task_set_task_data (task, (gpointer) "org.gnome.SessionManager.Reboot", NULL);
g_dbus_connection_call (bus,
"org.gnome.SessionManager",
@@ -1017,6 +1020,9 @@ gs_utils_invoke_reboot_ready1_got_session_bus_cb (GObject *source_object,
return;
}
+ /* Make sure file buffers are written to the disk before invoking reboot */
+ sync ();
+
cancellable = g_task_get_cancellable (task);
xdg_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
@@ -1143,6 +1149,9 @@ gs_utils_invoke_reboot_got_system_bus_cb (GObject *source_object,
cancellable = g_task_get_cancellable (task);
+ /* Make sure file buffers are written to the disk before invoking reboot */
+ sync ();
+
g_dbus_connection_call (bus,
"org.freedesktop.login1",
"/org/freedesktop/login1",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]