[launchd-changes] [23060] trunk/launchd/src/launchd_core_logic.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Feb 13 17:52:08 PST 2007


Revision: 23060
          http://trac.macosforge.org/projects/launchd/changeset/23060
Author:   zarzycki at apple.com
Date:     2007-02-13 17:52:08 -0800 (Tue, 13 Feb 2007)

Log Message:
-----------
<rdar://problem/4922374> Let the stdout/sterr pipe linger longer for GUI applications

Modified Paths:
--------------
    trunk/launchd/src/launchd_core_logic.c

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2007-02-14 01:42:50 UTC (rev 23059)
+++ trunk/launchd/src/launchd_core_logic.c	2007-02-14 01:52:08 UTC (rev 23060)
@@ -273,7 +273,8 @@
 		     importing_global_env:1, importing_hard_limits:1, setmask:1, legacy_mach_job:1, runatload:1;
 	mode_t mask;
 	unsigned int globargv:1, wait4debugger:1, unload_at_exit:1, stall_before_exec:1, only_once:1,
-		     currently_ignored:1, forced_peers_to_demand_mode:1, setnice:1, hopefully_exits_last:1, removal_pending:1;
+		     currently_ignored:1, forced_peers_to_demand_mode:1, setnice:1, hopefully_exits_last:1, removal_pending:1,
+		     wait4pipe_eof:1;
 	char label[0];
 };
 
@@ -869,6 +870,7 @@
 	}
 
 	jr->unload_at_exit = true;
+	jr->wait4pipe_eof = true;
 	jr->stall_before_exec = w4d;
 
 	if (workingdir) {
@@ -1637,7 +1639,7 @@
 
 	job_log(j, LOG_DEBUG, "Reaping");
 
-	if (j->log_redirect_fd) {
+	if (j->log_redirect_fd && !j->wait4pipe_eof) {
 		job_assumes(j, close(j->log_redirect_fd) != -1);
 		j->log_redirect_fd = 0;
 	}
@@ -1773,6 +1775,7 @@
 		job_log(j, LOG_DEBUG, "Standard out/error pipe closed");
 		job_assumes(j, close(j->log_redirect_fd) != -1);
 		j->log_redirect_fd = 0;
+		job_dispatch(j, false);
 	} else if (job_assumes(j, rsz != -1)) {
 		buf[rsz] = '\0';
 
@@ -2996,6 +2999,10 @@
 		return true;
 	}
 
+	if (j->wait4pipe_eof && j->log_redirect_fd) {
+		return true;
+	}
+
 	if (j->p) {
 		return true;
 	}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070213/3cb1edfb/attachment.html


More information about the launchd-changes mailing list