[launchd-changes] [23141] trunk/launchd/src

source_changes at macosforge.org source_changes at macosforge.org
Tue Mar 6 16:54:30 PST 2007


Revision: 23141
          http://trac.macosforge.org/projects/launchd/changeset/23141
Author:   zarzycki at apple.com
Date:     2007-03-06 16:54:30 -0800 (Tue, 06 Mar 2007)

Log Message:
-----------
Allow jobs to tweak their basic start interval at runtime.

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

Modified: trunk/launchd/src/launchd_core_logic.c
===================================================================
--- trunk/launchd/src/launchd_core_logic.c	2007-03-07 00:45:44 UTC (rev 23140)
+++ trunk/launchd/src/launchd_core_logic.c	2007-03-07 00:54:30 UTC (rev 23141)
@@ -4194,6 +4194,9 @@
 	case VPROC_GSK_BASIC_KEEPALIVE:
 		*outval = !j->ondemand;
 		break;
+	case VPROC_GSK_START_INTERVAL:
+		*outval = j->start_interval;
+		break;
 	case 0:
 		*outval = 0;
 		break;
@@ -4209,6 +4212,15 @@
 	case VPROC_GSK_BASIC_KEEPALIVE:
 		j->ondemand = !inval;
 		break;
+	case VPROC_GSK_START_INTERVAL:
+		if ((unsigned int)inval > 0) {
+			j->start_interval = inval;
+			job_assumes(j, kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, j->start_interval, j) != -1);
+		} else if (j->start_interval) {
+			job_assumes(j, kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1);
+			j->start_interval = 0;
+		}
+		break;
 	case 0:
 		break;
 	case VPROC_GSK_IS_NATIVE:

Modified: trunk/launchd/src/libvproc_public.h
===================================================================
--- trunk/launchd/src/libvproc_public.h	2007-03-07 00:45:44 UTC (rev 23140)
+++ trunk/launchd/src/libvproc_public.h	2007-03-07 00:54:30 UTC (rev 23141)
@@ -34,6 +34,7 @@
 	VPROC_GSK_MGR_PID,
 	VPROC_GSK_IS_NATIVE,
 	VPROC_GSK_BASIC_KEEPALIVE,
+	VPROC_GSK_START_INTERVAL,
 } vproc_gsk_t;
 
 typedef void * vproc_err_t;

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20070306/18dba0b9/attachment.html


More information about the launchd-changes mailing list