diff src/sysdep.c @ 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 ff73961932eb
children bc1acd76b294
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);