Changeset 23303
- Timestamp:
- 07/11/07 11:10:33 (17 months ago)
- Files:
-
- 1 modified
-
trunk/launchd/src/launchd_core_logic.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/launchd_core_logic.c
r23301 r23303 168 168 static void socketgroup_callback(job_t j); 169 169 static void socketgroup_setup(launch_data_t obj, const char *key, void *context); 170 static void socketgroup_kevent_mod(job_t j, struct socketgroup *sg, bool do_add); 170 171 171 172 struct calendarinterval { … … 181 182 static bool calendarinterval_new(job_t j, struct tm *w); 182 183 static bool calendarinterval_new_from_obj(job_t j, launch_data_t obj); 184 static void calendarinterval_new_from_obj_dict_walk(launch_data_t obj, const char *key, void *context); 183 185 static void calendarinterval_delete(job_t j, struct calendarinterval *ci); 184 186 static void calendarinterval_setalarm(job_t j, struct calendarinterval *ci); … … 403 405 static void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); 404 406 static void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); 407 static void job_log_stdouterr2(job_t j, const char *msg, ...); 405 408 static void job_set_exeception_port(job_t j, mach_port_t port); 406 409 static kern_return_t job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus); … … 430 433 static bool cronemu_min(struct tm *wtm, int min); 431 434 432 static unsigned int total_children; 435 /* miscellaneous file local functions */ 433 436 static void ensure_root_bkgd_setup(void); 434 437 static int dir_has_files(job_t j, const char *path); 435 438 static char **mach_cmd2argv(const char *string); 436 439 static size_t our_strhash(const char *s) __attribute__((pure)); 440 static void extract_rcsid_substr(const char *i, char *o, size_t osz); 441 static void do_first_per_user_launchd_hack(void); 442 443 /* file local globals */ 444 static unsigned int total_children; 437 445 static mach_port_t the_exception_server; 438 446 static bool did_first_per_user_launchd_BootCache_hack; 439 447 static jobmgr_t background_jobmgr; 448 449 /* process wide globals */ 440 450 jobmgr_t root_jobmgr; 441 static jobmgr_t background_jobmgr;442 451 443 452 void … … 2003 2012 } 2004 2013 2005 staticvoid2014 void 2006 2015 job_log_stdouterr2(job_t j, const char *msg, ...) 2007 2016 { … … 2353 2362 } 2354 2363 2355 staticvoid2364 void 2356 2365 do_first_per_user_launchd_hack(void) 2357 2366 { … … 2813 2822 } 2814 2823 2815 staticvoid2824 void 2816 2825 extract_rcsid_substr(const char *i, char *o, size_t osz) 2817 2826 { … … 2994 3003 int fflags = 0; 2995 3004 3005 strlcpy(parentdir_path, dirname(si->what), sizeof(parentdir_path)); 3006 2996 3007 switch (si->why) { 2997 3008 case PATH_EXISTS: 2998 3009 fflags = NOTE_DELETE|NOTE_RENAME|NOTE_REVOKE|NOTE_EXTEND|NOTE_WRITE; 2999 strlcpy(parentdir_path, dirname(si->what), sizeof(parentdir_path));3000 which_path = parentdir_path;3001 3010 break; 3002 3011 case PATH_MISSING: … … 3012 3021 3013 3022 if (si->fd == -1) { 3014 si->fd = _fd(open(which_path, O_EVTONLY|O_NOCTTY)); 3023 if ((si->fd = _fd(open(which_path, O_EVTONLY|O_NOCTTY))) == -1) { 3024 which_path = parentdir_path; 3025 si->fd = _fd(open(which_path, O_EVTONLY|O_NOCTTY)); 3026 } 3015 3027 } 3016 3028 … … 3087 3099 } 3088 3100 3089 staticvoid3101 void 3090 3102 calendarinterval_new_from_obj_dict_walk(launch_data_t obj, const char *key, void *context) 3091 3103 { … … 3246 3258 } 3247 3259 3248 staticvoid3260 void 3249 3261 socketgroup_kevent_mod(job_t j, struct socketgroup *sg, bool do_add) 3250 3262 {

