master 6ef0e6ba1a7: Send systemd notification after 'kill-emacs-hook'

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 6ef0e6ba1a78aa0c61a5a97d954a33ff4cadc049
Author: Lin Sun <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Send systemd notification after 'kill-emacs-hook'
    
    * src/emacs.c (kill-emacs): Send systemd STOPPING notification only
    after calling 'kill-emacs-hook', because that hook could prevent
    Emacs from exiting.  (Bug#81296)
---
 src/emacs.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index 3a9c7458e49..703ceec1045 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -2998,13 +2998,6 @@ killed.  */
     }
 #endif
 
-#ifdef HAVE_LIBSYSTEMD
-  /* Notify systemd we are shutting down, but only if we have notified
-     it about startup.  */
-  if (daemon_type == -1)
-    sd_notify(0, "STOPPING=1");
-#endif /* HAVE_LIBSYSTEMD */
-
   /* Fsignal calls emacs_abort () if it sees that waiting_for_input is
      set.  */
   waiting_for_input = 0;
@@ -3016,6 +3009,13 @@ killed.  */
 	calln (Qrun_hook_query_error_with_timeout, Qkill_emacs_hook);
     }
 
+#ifdef HAVE_LIBSYSTEMD
+  /* Notify systemd we are shutting down, but only if we have notified
+     it about startup.  */
+  if (daemon_type == -1)
+    sd_notify (0, "STOPPING=1");
+#endif /* HAVE_LIBSYSTEMD */
+
 #ifdef HAVE_X_WINDOWS
   /* Transfer any clipboards we own to the clipboard manager.  */
   x_clipboard_manager_save_all ();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.