Changeset 23369
- Timestamp:
- 09/11/07 13:05:15 (15 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchd_core_logic.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23368 r23369 24 24 #include <mach/mach.h> 25 25 #include <mach/mach_error.h> 26 #include <mach/mach_time.h> 26 27 #include <mach/boolean.h> 27 28 #include <mach/message.h> … … 349 350 int stdout_err_fd; 350 351 struct timeval sent_sigterm_time; 351 time_t start_time;352 time_t min_run_time;352 uint64_t start_time; 353 uint32_t min_run_time; 353 354 unsigned int start_interval; 354 355 unsigned int checkedin:1, anonymous:1, debug:1, inetcompat:1, inetcompat_wait:1, … … 2285 2286 job_start(job_t j) 2286 2287 { 2288 static mach_timebase_info_data_t tbi; 2289 uint64_t td, tnow = mach_absolute_time(); 2287 2290 int spair[2]; 2288 2291 int execspair[2]; … … 2291 2294 pid_t c; 2292 2295 bool sipc = false; 2293 time_t td;2294 2296 u_int proc_fflags = /* NOTE_EXEC|NOTE_FORK| */ NOTE_EXIT /* |NOTE_REAP */; 2297 2298 if (tbi.denom == 0) { 2299 launchd_assert(mach_timebase_info(&tbi) == 0); 2300 } 2295 2301 2296 2302 if (!job_assumes(j, j->mgr != NULL)) { … … 2303 2309 } 2304 2310 2305 td = time(NULL) - j->start_time; 2311 td = (tnow - j->start_time) * tbi.numer / tbi.denom; 2312 td /= NSEC_PER_SEC; 2306 2313 2307 2314 if (td < j->min_run_time && !j->legacy_mach_job && !j->inetcompat) { … … 2335 2342 } 2336 2343 2337 time(&j->start_time);2344 j->start_time = tnow; 2338 2345 2339 2346 switch (c = runtime_fork(j->weird_bootstrap ? j->j_port : j->mgr->jm_port)) {

