mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-03 23:09:34 +00:00
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.
This commit is contained in:
@@ -912,13 +912,8 @@ and do a 'v' before trying anything else.";
|
|||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
sprintf(errormsg, "HANGUP signalled (code %d) at address %p.\n%s", code, addr, stdmsg);
|
sprintf(errormsg, "HANGUP signalled (code %d) at address %p.\n%s", code, addr, stdmsg);
|
||||||
/* Assume that a user tried to exit UNIX shell */
|
/* Assume that a user tried to exit UNIX shell */
|
||||||
#ifdef SYSVONLY
|
|
||||||
kill(0, SIGKILL);
|
|
||||||
exit(0);
|
|
||||||
#else
|
|
||||||
killpg(getpgrp(), SIGKILL);
|
killpg(getpgrp(), SIGKILL);
|
||||||
exit(0);
|
exit(0);
|
||||||
#endif /* SYSVONLY */
|
|
||||||
break;
|
break;
|
||||||
#endif /* SIGHUP */
|
#endif /* SIGHUP */
|
||||||
case SIGFPE:
|
case SIGFPE:
|
||||||
|
|||||||
@@ -803,18 +803,8 @@ LispPTR Unix_handlecomm(LispPTR *args) {
|
|||||||
/* Change window size, then
|
/* Change window size, then
|
||||||
notify process group of the change */
|
notify process group of the change */
|
||||||
if ((ioctl(pty, TIOCSWINSZ, &w) >= 0) &&
|
if ((ioctl(pty, TIOCSWINSZ, &w) >= 0) &&
|
||||||
#ifdef ISC
|
((pgrp = tcgetpgrp(pty)) >= 0) &&
|
||||||
(tcgetpgrp(pty) >= 0) &&
|
|
||||||
#else
|
|
||||||
(ioctl(pty, TIOCGPGRP, &pgrp) >= 0) &&
|
|
||||||
#endif /* ISC */
|
|
||||||
|
|
||||||
#ifdef SYSVONLY
|
|
||||||
(kill(-pgrp, SIGWINCH) >= 0))
|
|
||||||
#else
|
|
||||||
(killpg(pgrp, SIGWINCH) >= 0))
|
(killpg(pgrp, SIGWINCH) >= 0))
|
||||||
#endif /* SYSVONLY */
|
|
||||||
|
|
||||||
return (ATOM_T);
|
return (ATOM_T);
|
||||||
return (GetSmallp(errno));
|
return (GetSmallp(errno));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,11 +344,7 @@ LispPTR suspend_lisp(LispPTR *args) {
|
|||||||
/* Send a terminal-stop signal to the whole process-group, not
|
/* Send a terminal-stop signal to the whole process-group, not
|
||||||
just this process, so that if we are running as part of a
|
just this process, so that if we are running as part of a
|
||||||
C-shell file the shell will be suspended too. */
|
C-shell file the shell will be suspended too. */
|
||||||
#ifdef SYSVONLY
|
|
||||||
kill(0, SIGTSTP);
|
|
||||||
#else
|
|
||||||
killpg(getpgrp(), SIGTSTP);
|
killpg(getpgrp(), SIGTSTP);
|
||||||
#endif /* SYSVONLY */
|
|
||||||
|
|
||||||
OSMESSAGE_PRINT(printf("resuming\n"));
|
OSMESSAGE_PRINT(printf("resuming\n"));
|
||||||
device_after_raid();
|
device_after_raid();
|
||||||
|
|||||||
Reference in New Issue
Block a user