diff options
author | Richard M. Stallman <rms@gnu.org> | 1992-09-19 20:41:32 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1992-09-19 20:41:32 +0000 |
commit | 84d538c5b08250a6c933d263c5f23ffd0c56e036 (patch) | |
tree | 5373e64027629c2a7fe62c934311863c91ae13f3 | |
parent | 9e3e9a43a0fd94b55a5eaca6d5c0d06aeb9d4683 (diff) | |
download | emacs-84d538c5b08250a6c933d263c5f23ffd0c56e036.tar.gz |
(sys_suspend): Read EMACS_PARENT_PID envvar for parent.
-rw-r--r-- | src/sysdep.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/sysdep.c b/src/sysdep.c index 74b895288e9..b8f819ddbaa 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -500,9 +500,26 @@ struct save_signal sys_suspend () { #ifdef VMS - unsigned long parent_id; + /* "Foster" parentage allows emacs to return to a subprocess that attached + to the current emacs as a cheaper than starting a whole new process. This + is set up by KEPTEDITOR.COM. */ + unsigned long parent_id, foster_parent_id; + char *fpid_string; + + fpid_string = getenv ("EMACS_PARENT_PID"); + if (fpid_string != NULL) + { + sscanf (fpid_string, "%x", &foster_parent_id); + if (foster_parent_id != 0) + parent_id = foster_parent_id; + else + parent_id = getppid (); + } + else + parent_id = getppid (); + + free (fpid_string); /* On VMS, this was malloc'd */ - parent_id = getppid (); if (parent_id && parent_id != 0xffffffff) { SIGTYPE (*oldsig)() = (int) signal (SIGINT, SIG_IGN); |