summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2021-01-27 07:55:11 -0800
committerGlenn Morris <rgm@gnu.org>2021-01-27 07:55:11 -0800
commit0ca75f19561f7c1100ec97e5af019977443a575b (patch)
tree6255d714809b1e3d53e6ded4092722bc1ec49efe /src
parent55973984629cc08a3dbf9c7c4367851b712be21b (diff)
parent3f610177adb844248fe37f52eb713d462e833a62 (diff)
downloademacs-0ca75f19561f7c1100ec97e5af019977443a575b.tar.gz
Merge from origin/emacs-27
3f610177ad Avoid sending systemd shutdown notifications if non-daemon 009df5cb3c * src/cmds.c (Fforward_line): Doc fix. (Bug#46027) ee1c54ebc0 Improve documentation of sendmail.el defcustom's
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c1
-rw-r--r--src/emacs.c10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 1547db80e88..c8a96d918cd 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -99,6 +99,7 @@ DEFUN ("forward-line", Fforward_line, Sforward_line, 0, 1, "^p",
Precisely, if point is on line I, move to the start of line I + N
\("start of line" in the logical order).
If there isn't room, go as far as possible (no error).
+Interactively, N is the numeric prefix argument and defaults to 1.
Returns the count of lines left to move. If moving forward,
that is N minus number of lines moved; if backward, N plus number
diff --git a/src/emacs.c b/src/emacs.c
index 77114271b27..fd08667f3fd 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -186,7 +186,8 @@ bool build_details;
/* Name for the server started by the daemon.*/
static char *daemon_name;
-/* 0 not a daemon, 1 new-style (foreground), 2 old-style (background). */
+/* 0 not a daemon, 1 new-style (foreground), 2 old-style (background).
+ A negative value means the daemon initialization was already done. */
int daemon_type;
#ifndef WINDOWSNT
@@ -2354,7 +2355,10 @@ all of which are called before Emacs is actually killed. */
int exit_code;
#ifdef HAVE_LIBSYSTEMD
- sd_notify(0, "STOPPING=1");
+ /* 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
@@ -2866,7 +2870,7 @@ from the parent process and its tty file descriptors. */)
}
/* Set it to an invalid value so we know we've already run this function. */
- daemon_type = -1;
+ daemon_type = -daemon_type;
#else /* WINDOWSNT */
/* Signal the waiting emacsclient process. */