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