# HG changeset patch # User Richard M. Stallman # Date 782479398 0 # Node ID 68882a46b5fc94350dd2c326107a4eaf03654072 # Parent 132798b0352b392256bf068e63ed7bb2a9d254d0 [SYSV_IPC] (main): Catch SIGHUP as well. Don't call kill with pid 0. Handle EINTR when receiving messages. diff -r 132798b0352b -r 68882a46b5fc lib-src/emacsserver.c --- a/lib-src/emacsserver.c Tue Oct 18 07:36:39 1994 +0000 +++ b/lib-src/emacsserver.c Tue Oct 18 11:23:18 1994 +0000 @@ -252,6 +252,11 @@ #include #include #include +#include + +#ifndef errno +extern int errno; +#endif jmp_buf msgenv; @@ -303,11 +308,13 @@ if (setjmp (msgenv)) { msgctl (s, IPC_RMID, 0); - kill (p, SIGKILL); + if (p > 0) + kill (p, SIGKILL); exit (0); } signal (SIGTERM, msgcatch); signal (SIGINT, msgcatch); + signal (SIGHUP, msgcatch); if (p > 0) { /* This is executed in the original process that did the fork above. */ @@ -349,6 +356,10 @@ { if ((fromlen = msgrcv (s, msgp, BUFSIZ - 1, 1, 0)) < 0) { +#ifdef EINTR + if (errno == EINTR) + continue; +#endif perror ("msgrcv"); exit (1); }