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