termux-packages/packages/csh/proc.c.patch

49 lines
1.1 KiB
Diff

--- a/proc.c
+++ b/proc.c
@@ -75,13 +75,12 @@
int pid;
extern int insource;
int save_errno = errno;
- union wait w;
- int jobflags;
+ int jobflags, w;
struct rusage ru;
loop:
errno = 0; /* reset, just in case */
- pid = wait3(&w.w_status,
+ pid = wait4((pid_t)-1, &w,
(setintr && (intty || insource) ? WNOHANG | WUNTRACED : WNOHANG), &ru);
if (pid <= 0) {
@@ -103,7 +102,7 @@
pp->p_flags &= ~(PRUNNING | PSTOPPED | PREPORTED);
if (WIFSTOPPED(w)) {
pp->p_flags |= PSTOPPED;
- pp->p_reason = w.w_stopsig;
+ pp->p_reason = w;
}
else {
if (pp->p_flags & (PTIME | PPTIME) || adrof(STRtime))
@@ -111,16 +110,16 @@
pp->p_rusage = ru;
if (WIFSIGNALED(w)) {
- if (w.w_termsig == SIGINT)
+ if (w == SIGINT)
pp->p_flags |= PINTERRUPTED;
else
pp->p_flags |= PSIGNALED;
- if (w.w_coredump)
+ if (w)
pp->p_flags |= PDUMPED;
- pp->p_reason = w.w_termsig;
+ pp->p_reason = w;
}
else {
- pp->p_reason = w.w_retcode;
+ pp->p_reason = w;
if (pp->p_reason != 0)
pp->p_flags |= PAEXITED;
else