]> git.eshelyaron.com Git - emacs.git/commitdiff
(main) [HAVE_SYSVIPC]: Reverse test of fork value.
authorRichard M. Stallman <rms@gnu.org>
Tue, 8 Feb 1994 23:57:30 +0000 (23:57 +0000)
committerRichard M. Stallman <rms@gnu.org>
Tue, 8 Feb 1994 23:57:30 +0000 (23:57 +0000)
lib-src/emacsserver.c

index 5e23314885134293782fa61f020c13c9c961e7a2..cf7a6dd78d55e6ca3c0e1cc264f8c49767f92e4b 100644 (file)
@@ -282,13 +282,15 @@ main ()
     }
   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 @@ main ()
        }
     }
 
+  /* This is executed in the child made by forking above.  */
   while (1)
     {
       if ((fromlen = msgrcv (s, msgp, BUFSIZ - 1, 1, 0)) < 0)