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