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

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 17 10:27:39 PDT 2007


Revision: 23394
          http://trac.macosforge.org/projects/launchd/changeset/23394
Author:   zarzycki at apple.com
Date:     2007-09-17 10:27:38 -0700 (Mon, 17 Sep 2007)

Log Message:
-----------
<rdar://problem/5402927> Bug: launchd_core_logic.c:523 (23327):1: kill(j->p, SIGTERM) != -1

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-09-16 17:37:44 UTC (rev 23393)
+++ trunk/launchd/src/launchd_core_logic.c	2007-09-17 17:27:38 UTC (rev 23394)
@@ -523,7 +523,7 @@
 		return;
 	}
 
-	job_assumes(j, kill(j->p, SIGTERM) != -1);
+	job_assumes(j, killpg(j->p, SIGTERM) != -1);
 	j->sent_sigterm_time = mach_absolute_time();
 
 	if (j->exit_timeout) {
@@ -2147,7 +2147,7 @@
 		return;
 	}
 
-	job_assumes(j, kill(j->p, SIGKILL) != -1);
+	job_assumes(j, killpg(j->p, SIGKILL) != -1);
 
 	j->sent_sigkill = true;
 
@@ -2831,7 +2831,11 @@
 		setenv(ei->key, ei->value, 1);
 	}
 
-	job_assumes(j, setsid() != -1);
+	if (j->per_user) {
+		job_assumes(j, setsid() != -1);
+	} else {
+		job_assumes(j, setpgid(0, 0) != -1);
+	}
 }
 
 void
@@ -3319,7 +3323,7 @@
 	time_t now = time(NULL);
 
 	if (ci && (ci->when_next < now)) {
-		jobmgr_assumes(root_jobmgr, kill(getpid(), SIGUSR1) != -1);
+		jobmgr_assumes(root_jobmgr, raise(SIGUSR1) != -1);
 	}
 }
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070917/841d809a/attachment.html


More information about the launchd-changes mailing list