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