aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2022-02-10 15:00:24 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2022-02-10 15:00:24 -0500
commit938afb4d7acb9974d5789dfe4e322c0ccce0541e (patch)
tree39277f5007b758ce8cda31727c91391fd85b600d /io.c
parent438e6e6e6deb8f4831e84ffd17205dc14d3a2ebb (diff)
downloadegawk-938afb4d7acb9974d5789dfe4e322c0ccce0541e.tar.gz
egawk-938afb4d7acb9974d5789dfe4e322c0ccce0541e.tar.bz2
egawk-938afb4d7acb9974d5789dfe4e322c0ccce0541e.zip
Fix bug in exit status returned by close for a previously exited process.
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 1d440c1e..07d83689 100644
--- a/io.c
+++ b/io.c
@@ -2599,7 +2599,7 @@ wait_any(int interesting) /* pid of interest, if any */
for (redp = red_head; redp != NULL; redp = redp->next)
if (interesting == redp->pid) {
redp->pid = -1;
- redp->status = status;
+ redp->status = sanitize_exit_status(status);
break;
}
}
@@ -2629,7 +2629,7 @@ wait_any(int interesting) /* pid of interest, if any */
for (redp = red_head; redp != NULL; redp = redp->next)
if (pid == redp->pid) {
redp->pid = -1;
- redp->status = status;
+ redp->status = sanitize_exit_status(status);
break;
}
}