changeset 5856:16e98db8cc1b

(main) [HAVE_SYSVIPC]: Reverse test of fork value.
author Richard M. Stallman <rms@gnu.org>
date Tue, 08 Feb 1994 23:57:30 +0000
parents c23afcf4e954
children 03f8720af7fb
files lib-src/emacsserver.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/emacsserver.c	Tue Feb 08 23:50:09 1994 +0000
+++ b/lib-src/emacsserver.c	Tue Feb 08 23:57:30 1994 +0000
@@ -282,13 +282,15 @@
     }
   signal (SIGTERM, msgcatch);
   signal (SIGINT, msgcatch);
-  /* If parent goes away, remove message box and exit */
-  if (p == 0)
+  if (p > 0)
     {
+      /* This is executed in the original process that did the fork above.  */
+      /* Get pid of Emacs itself.  */
       p = getppid ();
       setpgrp ();		/* Gnu kills process group on exit */
       while (1)
 	{
+	  /* Is Emacs still alive?  */
 	  if (kill (p, 0) < 0)
 	    {
 	      msgctl (s, IPC_RMID, 0);
@@ -298,6 +300,7 @@
 	}
     }
 
+  /* This is executed in the child made by forking above.  */
   while (1)
     {
       if ((fromlen = msgrcv (s, msgp, BUFSIZ - 1, 1, 0)) < 0)