changeset 1171:5c942f6b2d63

(sys_suspend): Read EMACS_PARENT_PID envvar for parent.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Sep 1992 20:41:32 +0000
parents 54a44b2b9591
children c942305917c1
files src/sysdep.c
diffstat 1 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/sysdep.c	Sat Sep 19 19:40:38 1992 +0000
+++ b/src/sysdep.c	Sat Sep 19 20:41:32 1992 +0000
@@ -500,9 +500,26 @@
 sys_suspend ()
 {
 #ifdef VMS
-  unsigned long parent_id;
-
-  parent_id = getppid ();
+  /* "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 */
+
   if (parent_id && parent_id != 0xffffffff)
     {
       SIGTYPE (*oldsig)() = (int) signal (SIGINT, SIG_IGN);