Skip to content

Commit a47119f

Browse files
killpg is POSIX, so we can rely on it now. (#150)
This removes some usages of the SYSVONLY flag and lets us assume the existence of `killpg`. It also updates a bit of code to accurately populate the `pgrp` variable using `tcgetpgrp` rather than an ioctl.
1 parent f1647df commit a47119f

File tree

3 files changed

+1
-20
lines changed

3 files changed

+1
-20
lines changed

src/timer.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,8 @@ and do a 'v' before trying anything else.";
912912
case SIGHUP:
913913
sprintf(errormsg, "HANGUP signalled (code %d) at address %p.\n%s", code, addr, stdmsg);
914914
/* Assume that a user tried to exit UNIX shell */
915-
#ifdef SYSVONLY
916-
kill(0, SIGKILL);
917-
exit(0);
918-
#else
919915
killpg(getpgrp(), SIGKILL);
920916
exit(0);
921-
#endif /* SYSVONLY */
922917
break;
923918
#endif /* SIGHUP */
924919
case SIGFPE:

src/unixcomm.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -803,18 +803,8 @@ LispPTR Unix_handlecomm(LispPTR *args) {
803803
/* Change window size, then
804804
notify process group of the change */
805805
if ((ioctl(pty, TIOCSWINSZ, &w) >= 0) &&
806-
#ifdef ISC
807-
(tcgetpgrp(pty) >= 0) &&
808-
#else
809-
(ioctl(pty, TIOCGPGRP, &pgrp) >= 0) &&
810-
#endif /* ISC */
811-
812-
#ifdef SYSVONLY
813-
(kill(-pgrp, SIGWINCH) >= 0))
814-
#else
806+
((pgrp = tcgetpgrp(pty)) >= 0) &&
815807
(killpg(pgrp, SIGWINCH) >= 0))
816-
#endif /* SYSVONLY */
817-
818808
return (ATOM_T);
819809
return (GetSmallp(errno));
820810
}

src/uutils.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,7 @@ LispPTR suspend_lisp(LispPTR *args) {
344344
/* Send a terminal-stop signal to the whole process-group, not
345345
just this process, so that if we are running as part of a
346346
C-shell file the shell will be suspended too. */
347-
#ifdef SYSVONLY
348-
kill(0, SIGTSTP);
349-
#else
350347
killpg(getpgrp(), SIGTSTP);
351-
#endif /* SYSVONLY */
352348

353349
OSMESSAGE_PRINT(printf("resuming\n"));
354350
device_after_raid();

0 commit comments

Comments
 (0)