<rdar://problem/5025358> Bug: launchd_core_logic.c:562 (23087):2: TAILQ_NEXT(ji, sle) == NULL
--- trunk/launchd/src/launchd_core_logic.c 2007-02-27 20:08:06 UTC (rev 23114)
+++ trunk/launchd/src/launchd_core_logic.c 2007-02-27 20:28:31 UTC (rev 23115)
@@ -1648,7 +1648,7 @@
job_log(j, LOG_DEBUG, "Reaping");
- if (j->log_redirect_fd && !j->wait4pipe_eof) {
+ if (j->log_redirect_fd && (!j->wait4pipe_eof || j->mgr->shutting_down)) {
job_assumes(j, close(j->log_redirect_fd) != -1);
j->log_redirect_fd = 0;
}