# HG changeset patch # User Richard M. Stallman # Date 716935292 0 # Node ID 5c942f6b2d634373ca0cbd36f04977379912bc82 # Parent 54a44b2b959118e6e02aa0326af81ed490bfb601 (sys_suspend): Read EMACS_PARENT_PID envvar for parent. diff -r 54a44b2b9591 -r 5c942f6b2d63 src/sysdep.c --- 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);