c50088
diff --git a/io.c b/io.c
c50088
index 1d440c1..07d8368 100644
c50088
--- a/io.c
c50088
+++ b/io.c
c50088
@@ -2599,7 +2599,7 @@ wait_any(int interesting)	/* pid of interest, if any */
c50088
 		for (redp = red_head; redp != NULL; redp = redp->next)
c50088
 			if (interesting == redp->pid) {
c50088
 				redp->pid = -1;
c50088
-				redp->status = status;
c50088
+				redp->status = sanitize_exit_status(status);
c50088
 				break;
c50088
 			}
c50088
 	}
c50088
@@ -2629,7 +2629,7 @@ wait_any(int interesting)	/* pid of interest, if any */
c50088
 			for (redp = red_head; redp != NULL; redp = redp->next)
c50088
 				if (pid == redp->pid) {
c50088
 					redp->pid = -1;
c50088
-					redp->status = status;
c50088
+					redp->status = sanitize_exit_status(status);
c50088
 					break;
c50088
 				}
c50088
 		}