From source_changes at macosforge.org Wed Sep 6 09:20:23 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:29 2007 Subject: [launchd-changes] [22837] trunk/Makefile Message-ID: <20060906162023.D8A5421BD98A@cvs.opensource.apple.com> Revision: 22837 Author: zarzycki@apple.com Date: 2006-09-06 09:20:21 -0700 (Wed, 06 Sep 2006) Log Message: ----------- The compiler getting better and better at inlining and tail call optimization, which makes backtraces more and more nonsensical. Time to start saving off symbols... Modified Paths: -------------- trunk/Makefile Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2006-08-30 17:00:01 UTC (rev 22836) +++ trunk/Makefile 2006-09-06 16:20:21 UTC (rev 22837) @@ -13,6 +13,9 @@ mkdir -p $(DSTROOT)/Library/StartupItems chmod 755 $(DSTROOT)/Library/StartupItems rm -rf $(DSTROOT)/usr/local/lib/system + cp $(OBJROOT)/src/launchd $(SYMROOT) + cp $(OBJROOT)/src/launchctl $(SYMROOT) + cp $(OBJROOT)/src/launchproxy $(SYMROOT) endif launchd_libs:: install -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/5be7dc59/attachment.html From source_changes at macosforge.org Wed Sep 6 09:35:01 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:29 2007 Subject: [launchd-changes] [22838] trunk/launchd/src Message-ID: <20060906163501.CC62621BDBE9@cvs.opensource.apple.com> Revision: 22838 Author: zarzycki@apple.com Date: 2006-09-06 09:34:59 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Adopt SVN's Revision feature. Modified Paths: -------------- trunk/launchd/src/init.c trunk/launchd/src/launchctl.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c Property Changed: ---------------- trunk/launchd/src/init.c trunk/launchd/src/launchctl.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c Modified: trunk/launchd/src/init.c =================================================================== --- trunk/launchd/src/init.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/init.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -53,7 +53,7 @@ * SUCH DAMAGE. */ -static const char *const __rcs_file_version__ = "$Revision: 1.39 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/init.c ___________________________________________________________________ Name: svn:keywords + Revision Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/launchctl.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -18,7 +18,7 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -static const char *const __rcs_file_version__ = "$Revision: 1.89 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/launchctl.c ___________________________________________________________________ Name: svn:keywords + Revision Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/launchd.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -18,7 +18,7 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -static const char *const __rcs_file_version__ = "$Revision: 1.220 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/launchd.c ___________________________________________________________________ Name: svn:keywords + Revision Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -18,7 +18,7 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -static const char *const __rcs_file_version__ = "$Revision: 1.79 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/launchd_core_logic.c ___________________________________________________________________ Name: svn:keywords + Revision Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -25,7 +25,7 @@ * bootstrap.c -- implementation of bootstrap main service loop */ -static const char *const __rcs_file_version__ = "$Revision: 1.53 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/launchd_mach_ipc.c ___________________________________________________________________ Name: svn:keywords + Revision Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 16:20:21 UTC (rev 22837) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 16:34:59 UTC (rev 22838) @@ -18,7 +18,7 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -static const char *const __rcs_file_version__ = "$Revision: 1.13 $"; +static const char *const __rcs_file_version__ = "$Revision$"; #include #include Property changes on: trunk/launchd/src/launchd_unix_ipc.c ___________________________________________________________________ Name: svn:keywords + Revision -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/3da483fa/attachment.html From source_changes at macosforge.org Wed Sep 6 10:05:42 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:29 2007 Subject: [launchd-changes] [22839] trunk/launchd/src Message-ID: <20060906170542.2ACBA21BDCC5@cvs.opensource.apple.com> Revision: 22839 Author: zarzycki@apple.com Date: 2006-09-06 10:05:38 -0700 (Wed, 06 Sep 2006) Log Message: ----------- s,struct jobcb *,vproc_t ,g Modified Paths: -------------- trunk/launchd/src/launchd.c trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c trunk/launchd/src/launchd_unix_ipc.h Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd.c 2006-09-06 17:05:38 UTC (rev 22839) @@ -121,7 +121,7 @@ static bool re_exec_in_single_user_mode = false; static char *pending_stdout = NULL; static char *pending_stderr = NULL; -static struct jobcb *rlcj = NULL; +static vproc_t rlcj = NULL; static jmp_buf doom_doom_doom; sigset_t blocked_signals = 0; @@ -148,7 +148,7 @@ const char *session_type = NULL; const char *optargs = NULL; launch_data_t ldresp, ldmsg = launch_data_new_string(LAUNCH_KEY_CHECKIN); - struct jobcb *fbj = NULL; + vproc_t fbj = NULL; struct stat sb; size_t i, checkin_fdcnt = 0; int *checkin_fds = NULL; Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 17:05:38 UTC (rev 22839) @@ -81,7 +81,7 @@ struct machservice { SLIST_ENTRY(machservice) sle; - struct jobcb *job; + vproc_t job; mach_port_name_t port; unsigned int isActive:1, reset:1, recv:1, hide:1, kUNCServer:1, __junk:27; char name[0]; @@ -89,7 +89,7 @@ static void machservice_setup(launch_data_t obj, const char *key, void *context); static void machservice_setup_options(launch_data_t obj, const char *key, void *context); -static void machservice_resetport(struct jobcb *j, struct machservice *ms); +static void machservice_resetport(vproc_t j, struct machservice *ms); struct socketgroup { @@ -99,11 +99,11 @@ char name[0]; }; -static bool socketgroup_new(struct jobcb *j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds); -static void socketgroup_delete(struct jobcb *j, struct socketgroup *sg); -static void socketgroup_watch(struct jobcb *j, struct socketgroup *sg); -static void socketgroup_ignore(struct jobcb *j, struct socketgroup *sg); -static void socketgroup_callback(struct jobcb *j, struct kevent *kev); +static bool socketgroup_new(vproc_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds); +static void socketgroup_delete(vproc_t j, struct socketgroup *sg); +static void socketgroup_watch(vproc_t j, struct socketgroup *sg); +static void socketgroup_ignore(vproc_t j, struct socketgroup *sg); +static void socketgroup_callback(vproc_t j, struct kevent *kev); static void socketgroup_setup(launch_data_t obj, const char *key, void *context); struct watchpath { @@ -113,22 +113,22 @@ char name[0]; }; -static bool watchpath_new(struct jobcb *j, const char *name, bool qdir); -static void watchpath_delete(struct jobcb *j, struct watchpath *wp); -static void watchpath_watch(struct jobcb *j, struct watchpath *wp); -static void watchpath_ignore(struct jobcb *j, struct watchpath *wp); -static void watchpath_callback(struct jobcb *j, struct kevent *kev); +static bool watchpath_new(vproc_t j, const char *name, bool qdir); +static void watchpath_delete(vproc_t j, struct watchpath *wp); +static void watchpath_watch(vproc_t j, struct watchpath *wp); +static void watchpath_ignore(vproc_t j, struct watchpath *wp); +static void watchpath_callback(vproc_t j, struct kevent *kev); struct calendarinterval { SLIST_ENTRY(calendarinterval) sle; struct tm when; }; -static bool calendarinterval_new(struct jobcb *j, struct tm *w); -static bool calendarinterval_new_from_obj(struct jobcb *j, launch_data_t obj); -static void calendarinterval_delete(struct jobcb *j, struct calendarinterval *ci); -static void calendarinterval_setalarm(struct jobcb *j, struct calendarinterval *ci); -static void calendarinterval_callback(struct jobcb *j, struct kevent *kev); +static bool calendarinterval_new(vproc_t j, struct tm *w); +static bool calendarinterval_new_from_obj(vproc_t j, launch_data_t obj); +static void calendarinterval_delete(vproc_t j, struct calendarinterval *ci); +static void calendarinterval_setalarm(vproc_t j, struct calendarinterval *ci); +static void calendarinterval_callback(vproc_t j, struct kevent *kev); struct envitem { SLIST_ENTRY(envitem) sle; @@ -136,8 +136,8 @@ char key[0]; }; -static bool envitem_new(struct jobcb *j, const char *k, const char *v, bool global); -static void envitem_delete(struct jobcb *j, struct envitem *ei, bool global); +static bool envitem_new(vproc_t j, const char *k, const char *v, bool global); +static void envitem_delete(vproc_t j, struct envitem *ei, bool global); static void envitem_setup(launch_data_t obj, const char *key, void *context); struct limititem { @@ -146,8 +146,8 @@ unsigned int setsoft:1, sethard:1, which:30; }; -static bool limititem_update(struct jobcb *j, int w, rlim_t r); -static void limititem_delete(struct jobcb *j, struct limititem *li); +static bool limititem_update(vproc_t j, int w, rlim_t r); +static void limititem_delete(vproc_t j, struct limititem *li); static void limititem_setup(launch_data_t obj, const char *key, void *context); typedef enum { @@ -166,15 +166,15 @@ char what[0]; }; -static bool semaphoreitem_new(struct jobcb *j, semaphore_reason_t why, const char *what); -static void semaphoreitem_delete(struct jobcb *j, struct semaphoreitem *si); +static bool semaphoreitem_new(vproc_t j, semaphore_reason_t why, const char *what); +static void semaphoreitem_delete(vproc_t j, struct semaphoreitem *si); static void semaphoreitem_setup(launch_data_t obj, const char *key, void *context); static void semaphoreitem_setup_paths(launch_data_t obj, const char *key, void *context); -struct jobcb { +struct vproc_s { kq_callback kqjob_callback; - SLIST_ENTRY(jobcb) sle; + SLIST_ENTRY(vproc_s) sle; SLIST_HEAD(, socketgroup) sockets; SLIST_HEAD(, watchpath) vnodes; SLIST_HEAD(, calendarinterval) cal_intervals; @@ -183,9 +183,9 @@ SLIST_HEAD(, limititem) limits; SLIST_HEAD(, machservice) machservices; SLIST_HEAD(, semaphoreitem) semaphores; - SLIST_HEAD(, jobcb) jobs; + SLIST_HEAD(, vproc_s) jobs; struct rusage ru; - struct jobcb *parent; + vproc_t parent; mach_port_t bs_port; mach_port_t req_port; mach_port_t wait_reply_port; @@ -215,29 +215,29 @@ char label[0]; }; -static struct jobcb *job_import2(launch_data_t pload); +static vproc_t job_import2(launch_data_t pload); static void job_import_keys(launch_data_t obj, const char *key, void *context); -static void job_import_bool(struct jobcb *j, const char *key, bool value); -static void job_import_string(struct jobcb *j, const char *key, const char *value); -static void job_import_integer(struct jobcb *j, const char *key, long long value); -static void job_import_dictionary(struct jobcb *j, const char *key, launch_data_t value); -static void job_import_array(struct jobcb *j, const char *key, launch_data_t value); -static void job_watch(struct jobcb *j); -static void job_ignore(struct jobcb *j); -static void job_reap(struct jobcb *j); -static bool job_useless(struct jobcb *j); -static bool job_keepalive(struct jobcb *j); -static void job_start(struct jobcb *j); -static void job_start_child(struct jobcb *j, int execfd) __attribute__((noreturn)); -static void job_setup_attributes(struct jobcb *j); -static bool job_setup_machport(struct jobcb *j); -static void job_postfork_become_user(struct jobcb *j); +static void job_import_bool(vproc_t j, const char *key, bool value); +static void job_import_string(vproc_t j, const char *key, const char *value); +static void job_import_integer(vproc_t j, const char *key, long long value); +static void job_import_dictionary(vproc_t j, const char *key, launch_data_t value); +static void job_import_array(vproc_t j, const char *key, launch_data_t value); +static void job_watch(vproc_t j); +static void job_ignore(vproc_t j); +static void job_reap(vproc_t j); +static bool job_useless(vproc_t j); +static bool job_keepalive(vproc_t j); +static void job_start(vproc_t j); +static void job_start_child(vproc_t j, int execfd) __attribute__((noreturn)); +static void job_setup_attributes(vproc_t j); +static bool job_setup_machport(vproc_t j); +static void job_postfork_become_user(vproc_t j); static void job_callback(void *obj, struct kevent *kev); -static pid_t job_fork(struct jobcb *j); -static size_t job_prep_log_preface(struct jobcb *j, char *buf); -static void job_setup_env_from_other_jobs(struct jobcb *j); -static void job_export_all2(struct jobcb *j, launch_data_t where); -static launch_data_t job_export2(struct jobcb *j, bool subjobs); +static pid_t job_fork(vproc_t j); +static size_t job_prep_log_preface(vproc_t j, char *buf); +static void job_setup_env_from_other_jobs(vproc_t j); +static void job_export_all2(vproc_t j, launch_data_t where); +static launch_data_t job_export2(vproc_t j, bool subjobs); static const struct { @@ -266,10 +266,10 @@ kq_callback kqsimple_zombie_reaper = simple_zombie_reaper; -static int dir_has_files(struct jobcb *j, const char *path); +static int dir_has_files(vproc_t j, const char *path); static char **mach_cmd2argv(const char *string); -struct jobcb *root_job = NULL; -struct jobcb *gc_this_job = NULL; +vproc_t root_job = NULL; +vproc_t gc_this_job = NULL; size_t total_children = 0; void @@ -279,7 +279,7 @@ } void -job_ignore(struct jobcb *j) +job_ignore(vproc_t j) { struct socketgroup *sg; struct machservice *ms; @@ -296,7 +296,7 @@ } void -job_watch(struct jobcb *j) +job_watch(vproc_t j) { struct socketgroup *sg; struct machservice *ms; @@ -313,20 +313,20 @@ } void -job_stop(struct jobcb *j) +job_stop(vproc_t j) { if (j->p) kill(j->p, SIGTERM); } launch_data_t -job_export(struct jobcb *j) +job_export(vproc_t j) { return job_export2(j, true); } launch_data_t -job_export2(struct jobcb *j, bool subjobs) +job_export2(vproc_t j, bool subjobs) { launch_data_t tmp, tmp2, tmp3, r = launch_data_alloc(LAUNCH_DATA_DICTIONARY); @@ -403,7 +403,7 @@ } if (subjobs && !SLIST_EMPTY(&j->jobs) && (tmp = launch_data_alloc(LAUNCH_DATA_ARRAY))) { - struct jobcb *ji; + vproc_t ji; size_t i = 0; SLIST_FOREACH(ji, &j->jobs, sle) { @@ -419,9 +419,9 @@ } void -job_remove_all_inactive(struct jobcb *j) +job_remove_all_inactive(vproc_t j) { - struct jobcb *ji, *jn; + vproc_t ji, jn; SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { job_remove_all_inactive(ji); @@ -435,9 +435,9 @@ } void -job_remove(struct jobcb *j) +job_remove(vproc_t j) { - struct jobcb *ji; + vproc_t ji; struct calendarinterval *ci; struct socketgroup *sg; struct watchpath *wp; @@ -459,7 +459,7 @@ } if (j->parent) - SLIST_REMOVE(&j->parent->jobs, j, jobcb, sle); + SLIST_REMOVE(&j->parent->jobs, j, vproc_s, sle); if (j->execfd) job_assumes(j, close(j->execfd) == 0); @@ -545,7 +545,7 @@ socketgroup_setup(launch_data_t obj, const char *key, void *context) { launch_data_t tmp_oai; - struct jobcb *j = context; + vproc_t j = context; unsigned int i, fd_cnt = 1; int *fds; @@ -569,7 +569,7 @@ } bool -job_setup_machport(struct jobcb *j) +job_setup_machport(vproc_t j) { if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) goto out_bad; @@ -584,11 +584,11 @@ return false; } -struct jobcb * -job_new_via_mach_init(struct jobcb *jbs, const char *cmd, uid_t uid, bool ond) +vproc_t +job_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond) { const char **argv = (const char **)mach_cmd2argv(cmd); - struct jobcb *j = NULL; + vproc_t j = NULL; char buf[1000]; if (!job_assumes(jbs, argv != NULL)) @@ -630,7 +630,7 @@ } kern_return_t -job_handle_mpm_wait(struct jobcb *j, mach_port_t srp, int *waitstatus) +job_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus) { if (j->p) { j->wait_reply_port = srp; @@ -642,10 +642,10 @@ return 0; } -struct jobcb * +vproc_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc) { - struct jobcb *jr; + vproc_t jr; if ((jr = job_find(root_job, label)) != NULL) { errno = EEXIST; @@ -690,20 +690,20 @@ return jr; } -struct jobcb * -job_new(struct jobcb *p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) +vproc_t +job_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) { const char *const *argv_tmp = argv; char *co; int i, cc = 0; - struct jobcb *j; + vproc_t j; if (reqport == MACH_PORT_NULL && prog == NULL && argv == NULL) { errno = EINVAL; return NULL; } - j = calloc(1, sizeof(struct jobcb) + strlen(label) + 1); + j = calloc(1, sizeof(struct vproc_s) + strlen(label) + 1); if (!job_assumes(p, j != NULL)) goto out_bad; @@ -773,10 +773,10 @@ return NULL; } -struct jobcb * +vproc_t job_import(launch_data_t pload) { - struct jobcb *j = job_import2(pload); + vproc_t j = job_import2(pload); if (j == NULL) return NULL; @@ -790,10 +790,10 @@ job_import_bulk(launch_data_t pload) { launch_data_t resp = launch_data_alloc(LAUNCH_DATA_ARRAY); - struct jobcb **ja; + vproc_t *ja; size_t i, c = launch_data_array_get_count(pload); - ja = alloca(c * sizeof(struct jobcb *)); + ja = alloca(c * sizeof(vproc_t )); for (i = 0; i < c; i++) { if ((ja[i] = job_import2(launch_data_array_get_index(pload, i)))) @@ -811,7 +811,7 @@ } void -job_import_bool(struct jobcb *j, const char *key, bool value) +job_import_bool(vproc_t j, const char *key, bool value) { switch (key[0]) { case 'f': @@ -875,7 +875,7 @@ } void -job_import_string(struct jobcb *j, const char *key, const char *value) +job_import_string(vproc_t j, const char *key, const char *value) { char **where2put = NULL; @@ -945,7 +945,7 @@ } void -job_import_integer(struct jobcb *j, const char *key, long long value) +job_import_integer(vproc_t j, const char *key, long long value) { switch (key[0]) { case 'n': @@ -986,7 +986,7 @@ } void -job_import_dictionary(struct jobcb *j, const char *key, launch_data_t value) +job_import_dictionary(vproc_t j, const char *key, launch_data_t value) { launch_data_t tmp; @@ -1049,7 +1049,7 @@ } void -job_import_array(struct jobcb *j, const char *key, launch_data_t value) +job_import_array(vproc_t j, const char *key, launch_data_t value) { bool is_q_dir = false; bool is_wp = false; @@ -1097,7 +1097,7 @@ void job_import_keys(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; launch_data_type_t kind; if (obj == NULL) @@ -1127,13 +1127,13 @@ } } -struct jobcb * +vproc_t job_import2(launch_data_t pload) { launch_data_t tmp, ldpa; const char *label = NULL, *prog = NULL; const char **argv = NULL; - struct jobcb *j; + vproc_t j; if (pload == NULL) return NULL; @@ -1181,10 +1181,10 @@ return j; } -struct jobcb * -job_find(struct jobcb *j, const char *label) +vproc_t +job_find(vproc_t j, const char *label) { - struct jobcb *jr, *ji; + vproc_t jr, ji; if (label[0] == '\0') return root_job; @@ -1201,10 +1201,10 @@ return NULL; } -struct jobcb * -job_find_by_pid(struct jobcb *j, pid_t p) +vproc_t +job_find_by_pid(vproc_t j, pid_t p) { - struct jobcb *jr, *ji; + vproc_t jr, ji; if (j->p == p) return j; @@ -1219,10 +1219,10 @@ } void -job_export_all2(struct jobcb *j, launch_data_t where) +job_export_all2(vproc_t j, launch_data_t where) { launch_data_t tmp; - struct jobcb *ji; + vproc_t ji; if (job_assumes(j, (tmp = job_export2(j, false)) != NULL)) launch_data_dict_insert(where, tmp, j->label); @@ -1242,7 +1242,7 @@ } void -job_reap(struct jobcb *j) +job_reap(vproc_t j) { struct rusage ru; int status; @@ -1300,7 +1300,7 @@ } void -job_dispatch(struct jobcb *j, bool kickstart) +job_dispatch(vproc_t j, bool kickstart) { /* * The whole job removal logic needs to be consolidated. The fact that @@ -1324,7 +1324,7 @@ void job_callback(void *obj, struct kevent *kev) { - struct jobcb *j = obj; + vproc_t j = obj; bool d = j->debug; int oldmask = 0; @@ -1391,7 +1391,7 @@ } void -job_start(struct jobcb *j) +job_start(vproc_t j) { int spair[2]; int execspair[2]; @@ -1503,7 +1503,7 @@ } void -job_start_child(struct jobcb *j, int execfd) +job_start_child(vproc_t j, int execfd) { const char *file2exec = "/usr/libexec/launchproxy"; const char **argv; @@ -1564,10 +1564,10 @@ exit(EXIT_FAILURE); } -void job_setup_env_from_other_jobs(struct jobcb *j) +void job_setup_env_from_other_jobs(vproc_t j) { struct envitem *ei; - struct jobcb *ji; + vproc_t ji; SLIST_FOREACH(ji, &j->jobs, sle) job_setup_env_from_other_jobs(ji); @@ -1577,7 +1577,7 @@ } void -job_postfork_become_user(struct jobcb *j) +job_postfork_become_user(vproc_t j) { char loginname[2000]; struct passwd *pwe; @@ -1645,7 +1645,7 @@ } void -job_setup_attributes(struct jobcb *j) +job_setup_attributes(vproc_t j) { struct limititem *li; struct envitem *ei; @@ -1729,7 +1729,7 @@ } int -dir_has_files(struct jobcb *j, const char *path) +dir_has_files(vproc_t j, const char *path) { DIR *dd = opendir(path); struct dirent *de; @@ -1750,7 +1750,7 @@ } void -calendarinterval_setalarm(struct jobcb *j, struct calendarinterval *ci) +calendarinterval_setalarm(vproc_t j, struct calendarinterval *ci) { time_t later; @@ -1774,7 +1774,7 @@ } size_t -job_prep_log_preface(struct jobcb *j, char *buf) +job_prep_log_preface(vproc_t j, char *buf) { size_t lsz = strlen(j->label); char newlabel[lsz * 2 + 1]; @@ -1798,7 +1798,7 @@ } void -job_log_bug(struct jobcb *j, const char *rcs_rev, const char *path, unsigned int line, const char *test) +job_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test) { int saved_errno = errno; char buf[100]; @@ -1824,7 +1824,7 @@ } void -job_log_error(struct jobcb *j, int pri, const char *msg, ...) +job_log_error(vproc_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; @@ -1840,7 +1840,7 @@ } void -job_log(struct jobcb *j, int pri, const char *msg, ...) +job_log(vproc_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; @@ -1856,7 +1856,7 @@ } bool -watchpath_new(struct jobcb *j, const char *name, bool qdir) +watchpath_new(vproc_t j, const char *name, bool qdir) { struct watchpath *wp = calloc(1, sizeof(struct watchpath) + strlen(name) + 1); @@ -1875,7 +1875,7 @@ } void -watchpath_delete(struct jobcb *j, struct watchpath *wp) +watchpath_delete(vproc_t j, struct watchpath *wp) { if (wp->fd != -1) job_assumes(j, close(wp->fd) != -1); @@ -1886,7 +1886,7 @@ } void -watchpath_ignore(struct jobcb *j, struct watchpath *wp) +watchpath_ignore(vproc_t j, struct watchpath *wp) { if (wp->fd != -1) { job_log(j, LOG_DEBUG, "Ignoring Vnode: %d", wp->fd); @@ -1895,7 +1895,7 @@ } void -watchpath_watch(struct jobcb *j, struct watchpath *wp) +watchpath_watch(vproc_t j, struct watchpath *wp) { int fflags = NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK; int qdir_file_cnt; @@ -1923,7 +1923,7 @@ } void -watchpath_callback(struct jobcb *j, struct kevent *kev) +watchpath_callback(vproc_t j, struct kevent *kev) { struct watchpath *wp; int dir_file_cnt; @@ -1956,7 +1956,7 @@ } bool -calendarinterval_new_from_obj(struct jobcb *j, launch_data_t obj) +calendarinterval_new_from_obj(vproc_t j, launch_data_t obj) { launch_data_t tmp_k; struct tm tmptm; @@ -1987,7 +1987,7 @@ } bool -calendarinterval_new(struct jobcb *j, struct tm *w) +calendarinterval_new(vproc_t j, struct tm *w) { struct calendarinterval *ci = calloc(1, sizeof(struct calendarinterval)); @@ -2004,7 +2004,7 @@ } void -calendarinterval_delete(struct jobcb *j, struct calendarinterval *ci) +calendarinterval_delete(vproc_t j, struct calendarinterval *ci) { job_assumes(j, kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); @@ -2014,7 +2014,7 @@ } void -calendarinterval_callback(struct jobcb *j, struct kevent *kev) +calendarinterval_callback(vproc_t j, struct kevent *kev) { struct calendarinterval *ci; @@ -2030,7 +2030,7 @@ } bool -socketgroup_new(struct jobcb *j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds) +socketgroup_new(vproc_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds) { struct socketgroup *sg = calloc(1, sizeof(struct socketgroup) + strlen(name) + 1); @@ -2055,7 +2055,7 @@ } void -socketgroup_delete(struct jobcb *j, struct socketgroup *sg) +socketgroup_delete(vproc_t j, struct socketgroup *sg) { unsigned int i; @@ -2069,7 +2069,7 @@ } void -socketgroup_ignore(struct jobcb *j, struct socketgroup *sg) +socketgroup_ignore(vproc_t j, struct socketgroup *sg) { char buf[10000]; unsigned int i, buf_off = 0; @@ -2087,7 +2087,7 @@ } void -socketgroup_watch(struct jobcb *j, struct socketgroup *sg) +socketgroup_watch(vproc_t j, struct socketgroup *sg) { char buf[10000]; unsigned int i, buf_off = 0; @@ -2105,13 +2105,13 @@ } void -socketgroup_callback(struct jobcb *j, struct kevent *kev) +socketgroup_callback(vproc_t j, struct kevent *kev) { job_dispatch(j, true); } bool -envitem_new(struct jobcb *j, const char *k, const char *v, bool global) +envitem_new(vproc_t j, const char *k, const char *v, bool global) { struct envitem *ei = calloc(1, sizeof(struct envitem) + strlen(k) + 1 + strlen(v) + 1); @@ -2132,7 +2132,7 @@ } void -envitem_delete(struct jobcb *j, struct envitem *ei, bool global) +envitem_delete(vproc_t j, struct envitem *ei, bool global) { if (global) { SLIST_REMOVE(&j->global_env, ei, envitem, sle); @@ -2146,7 +2146,7 @@ void envitem_setup(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; if (launch_data_get_type(obj) != LAUNCH_DATA_STRING) return; @@ -2155,7 +2155,7 @@ } bool -limititem_update(struct jobcb *j, int w, rlim_t r) +limititem_update(vproc_t j, int w, rlim_t r) { struct limititem *li; @@ -2185,7 +2185,7 @@ } void -limititem_delete(struct jobcb *j, struct limititem *li) +limititem_delete(vproc_t j, struct limititem *li) { SLIST_REMOVE(&j->limits, li, limititem, sle); @@ -2195,7 +2195,7 @@ void limititem_setup(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; int i, limits_cnt = (sizeof(launchd_keys2limits) / sizeof(launchd_keys2limits[0])); rlim_t rl; @@ -2216,7 +2216,7 @@ } bool -job_useless(struct jobcb *j) +job_useless(vproc_t j) { if (j->unload_at_exit && j->start_time != 0) { job_log(j, LOG_INFO, "Exited. Was only configured to run once."); @@ -2236,7 +2236,7 @@ } bool -job_keepalive(struct jobcb *j) +job_keepalive(vproc_t j) { mach_msg_type_number_t statusCnt; mach_port_status_t status; @@ -2311,7 +2311,7 @@ } const char * -job_prog(struct jobcb *j) +job_prog(vproc_t j) { if (j->prog) { return j->prog; @@ -2323,7 +2323,7 @@ } bool -job_active(struct jobcb *j) +job_active(vproc_t j) { struct machservice *ms; @@ -2360,7 +2360,7 @@ } pid_t -job_fork(struct jobcb *j) +job_fork(vproc_t j) { mach_port_t p = j->bs_port; pid_t r = -1; @@ -2390,7 +2390,7 @@ } void -machservice_resetport(struct jobcb *j, struct machservice *ms) +machservice_resetport(vproc_t j, struct machservice *ms) { job_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); job_assumes(j, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); @@ -2399,7 +2399,7 @@ } struct machservice * -machservice_new(struct jobcb *j, const char *name, mach_port_t *serviceport) +machservice_new(vproc_t j, const char *name, mach_port_t *serviceport) { struct machservice *ms; @@ -2522,7 +2522,7 @@ void machservice_setup(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; struct machservice *ms; mach_port_t p = MACH_PORT_NULL; @@ -2543,14 +2543,14 @@ } } -struct jobcb * -job_parent(struct jobcb *j) +vproc_t +job_parent(vproc_t j) { return j->parent; } void -job_uncork_fork(struct jobcb *j) +job_uncork_fork(vproc_t j) { pid_t c = j->p; @@ -2566,10 +2566,10 @@ } void -job_foreach_service(struct jobcb *j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) +job_foreach_service(vproc_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) { struct machservice *ms; - struct jobcb *ji; + vproc_t ji; j = job_get_bs(j); @@ -2587,11 +2587,11 @@ bs_iter(ms, context); } -struct jobcb * -job_new_bootstrap(struct jobcb *p, mach_port_t requestorport, mach_port_t checkin_port) +vproc_t +job_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port) { char bslabel[1024] = "100000"; - struct jobcb *j; + vproc_t j; if (requestorport == MACH_PORT_NULL) { if (p) { @@ -2629,10 +2629,10 @@ } void -job_delete_anything_with_port(struct jobcb *j, mach_port_t port) +job_delete_anything_with_port(vproc_t j, mach_port_t port) { struct machservice *ms, *next_ms; - struct jobcb *ji, *jn; + vproc_t ji, jn; /* Mach ports, unlike Unix descriptors, are reference counted. In other * words, when some program hands us a second or subsequent send right @@ -2664,10 +2664,10 @@ } struct machservice * -job_lookup_service(struct jobcb *j, const char *name, bool check_parent) +job_lookup_service(vproc_t j, const char *name, bool check_parent) { struct machservice *ms; - struct jobcb *ji; + vproc_t ji; j = job_get_bs(j); @@ -2701,7 +2701,7 @@ return ms->port; } -struct jobcb * +vproc_t machservice_job(struct machservice *ms) { return ms->job; @@ -2810,15 +2810,15 @@ } void -job_checkin(struct jobcb *j) +job_checkin(vproc_t j) { j->checkedin = true; } bool -job_ack_port_destruction(struct jobcb *j, mach_port_t p) +job_ack_port_destruction(vproc_t j, mach_port_t p) { - struct jobcb *ji; + vproc_t ji; struct machservice *ms; SLIST_FOREACH(ji, &j->jobs, sle) { @@ -2847,7 +2847,7 @@ } void -job_ack_no_senders(struct jobcb *j) +job_ack_no_senders(vproc_t j) { j->priv_port_has_senders = false; @@ -2857,7 +2857,7 @@ } mach_port_t -job_get_reqport(struct jobcb *j) +job_get_reqport(vproc_t j) { j->transfer_bstrap = true; gc_this_job = j; @@ -2866,13 +2866,13 @@ } mach_port_t -job_get_bsport(struct jobcb *j) +job_get_bsport(vproc_t j) { return j->bs_port; } -struct jobcb * -job_get_bs(struct jobcb *j) +vproc_t +job_get_bs(vproc_t j) { if (j->req_port) return j; @@ -2884,13 +2884,13 @@ } pid_t -job_get_pid(struct jobcb *j) +job_get_pid(vproc_t j) { return j->p; } bool -semaphoreitem_new(struct jobcb *j, semaphore_reason_t why, const char *what) +semaphoreitem_new(vproc_t j, semaphore_reason_t why, const char *what) { struct semaphoreitem *si; size_t alloc_sz = sizeof(struct semaphoreitem); @@ -2912,7 +2912,7 @@ } void -semaphoreitem_delete(struct jobcb *j, struct semaphoreitem *ri) +semaphoreitem_delete(vproc_t j, struct semaphoreitem *ri) { SLIST_REMOVE(&j->semaphores, ri, semaphoreitem, sle); @@ -2922,7 +2922,7 @@ void semaphoreitem_setup_paths(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; semaphore_reason_t why; why = launch_data_get_bool(obj) ? PATH_EXISTS : PATH_MISSING; @@ -2933,7 +2933,7 @@ void semaphoreitem_setup(launch_data_t obj, const char *key, void *context) { - struct jobcb *j = context; + vproc_t j = context; semaphore_reason_t why; if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE_NETWORKSTATE) == 0) { @@ -2950,9 +2950,9 @@ } void -job_dispatch_all_other_semaphores(struct jobcb *j, struct jobcb *nj) +job_dispatch_all_other_semaphores(vproc_t j, vproc_t nj) { - struct jobcb *ji, *jn; + vproc_t ji, jn; if (j == nj) return; Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-06 17:05:38 UTC (rev 22839) @@ -28,60 +28,60 @@ (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) -struct jobcb; +typedef struct vproc_s *vproc_t; struct machservice; -struct machservice *machservice_new(struct jobcb *j, const char *name, mach_port_t *serviceport); +struct machservice *machservice_new(vproc_t j, const char *name, mach_port_t *serviceport); void machservice_delete(struct machservice *); void machservice_watch(struct machservice *); mach_port_t machservice_port(struct machservice *); -struct jobcb *machservice_job(struct machservice *); +vproc_t machservice_job(struct machservice *); bool machservice_hidden(struct machservice *); bool machservice_active(struct machservice *); const char *machservice_name(struct machservice *); bootstrap_status_t machservice_status(struct machservice *); -struct jobcb *job_find(struct jobcb *j, const char *label); -struct jobcb *job_find_by_pid(struct jobcb *j, pid_t p); -struct jobcb *job_find_by_port(mach_port_t mp); -struct jobcb *job_import(launch_data_t pload); +vproc_t job_find(vproc_t j, const char *label); +vproc_t job_find_by_pid(vproc_t j, pid_t p); +vproc_t job_find_by_port(mach_port_t mp); +vproc_t job_import(launch_data_t pload); launch_data_t job_import_bulk(launch_data_t pload); -struct jobcb *job_new(struct jobcb *p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); -struct jobcb *job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); -struct jobcb *job_new_via_mach_init(struct jobcb *jbs, const char *cmd, uid_t uid, bool ond); -struct jobcb *job_new_bootstrap(struct jobcb *p, mach_port_t requestorport, mach_port_t checkin_port); -launch_data_t job_export(struct jobcb *j); +vproc_t job_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); +vproc_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); +vproc_t job_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond); +vproc_t job_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port); +launch_data_t job_export(vproc_t j); launch_data_t job_export_all(void); -void job_dispatch(struct jobcb *j, bool kickstart); -void job_dispatch_all_other_semaphores(struct jobcb *j, struct jobcb *nj); -void job_stop(struct jobcb *j); -bool job_active(struct jobcb *j); -void job_checkin(struct jobcb *j); -const char *job_prog(struct jobcb *j); -void job_remove(struct jobcb *j); -void job_remove_all_inactive(struct jobcb *j); -bool job_ack_port_destruction(struct jobcb *j, mach_port_t p); -void job_ack_no_senders(struct jobcb *j); -pid_t job_get_pid(struct jobcb *j); -mach_port_t job_get_bsport(struct jobcb *j); -mach_port_t job_get_reqport(struct jobcb *j); -struct jobcb *job_get_bs(struct jobcb *j); -void job_delete_anything_with_port(struct jobcb *jbs, mach_port_t port); -struct jobcb *job_parent(struct jobcb *j); -void job_uncork_fork(struct jobcb *j); -struct machservice *job_lookup_service(struct jobcb *jbs, const char *name, bool check_parent); -void job_foreach_service(struct jobcb *jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); -void job_log(struct jobcb *j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_error(struct jobcb *j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_bug(struct jobcb *j, const char *rcs_rev, const char *path, unsigned int line, const char *test); -kern_return_t job_handle_mpm_wait(struct jobcb *j, mach_port_t srp, int *waitstatus); +void job_dispatch(vproc_t j, bool kickstart); +void job_dispatch_all_other_semaphores(vproc_t j, vproc_t nj); +void job_stop(vproc_t j); +bool job_active(vproc_t j); +void job_checkin(vproc_t j); +const char *job_prog(vproc_t j); +void job_remove(vproc_t j); +void job_remove_all_inactive(vproc_t j); +bool job_ack_port_destruction(vproc_t j, mach_port_t p); +void job_ack_no_senders(vproc_t j); +pid_t job_get_pid(vproc_t j); +mach_port_t job_get_bsport(vproc_t j); +mach_port_t job_get_reqport(vproc_t j); +vproc_t job_get_bs(vproc_t j); +void job_delete_anything_with_port(vproc_t jbs, mach_port_t port); +vproc_t job_parent(vproc_t j); +void job_uncork_fork(vproc_t j); +struct machservice *job_lookup_service(vproc_t jbs, const char *name, bool check_parent); +void job_foreach_service(vproc_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); +void job_log(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void job_log_error(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void job_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); +kern_return_t job_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus); extern size_t total_children; -extern struct jobcb *root_job; +extern vproc_t root_job; -extern struct jobcb *gc_this_job; +extern vproc_t gc_this_job; #endif Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 17:05:38 UTC (rev 22839) @@ -88,9 +88,9 @@ static void **port_to_obj = NULL; static pthread_t demand_thread; -static bool trusted_client_check(struct jobcb *j, struct ldcred *ldc); +static bool trusted_client_check(vproc_t j, struct ldcred *ldc); -struct jobcb * +vproc_t job_find_by_port(mach_port_t mp) { return port_to_obj[MACH_PORT_INDEX(mp)]; @@ -330,7 +330,7 @@ x_bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, audit_token_t au_tok, mach_port_t *server_portp) { - struct jobcb *js, *j = job_find_by_port(bp); + vproc_t js, j = job_find_by_port(bp); struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); @@ -382,7 +382,7 @@ kern_return_t x_bootstrap_unprivileged(mach_port_t bp, mach_port_t *unprivportp) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); @@ -398,7 +398,7 @@ x_bootstrap_check_in(mach_port_t bp, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) { static pid_t last_warned_pid = 0; - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -437,7 +437,7 @@ kern_return_t x_bootstrap_register(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -475,7 +475,7 @@ kern_return_t x_bootstrap_look_up(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -508,7 +508,7 @@ kern_return_t x_bootstrap_parent(mach_port_t bp, mach_port_t *parentport, mach_msg_type_name_t *pptype) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); @@ -564,7 +564,7 @@ bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - struct jobcb *ji, *j = job_find_by_port(bp); + vproc_t ji, j = job_find_by_port(bp); kern_return_t result; unsigned int cnt = 0; @@ -603,7 +603,7 @@ mach_port_array_t *ports, unsigned int *ports_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); unsigned int cnt = 0; kern_return_t result; @@ -654,7 +654,7 @@ kern_return_t x_bootstrap_subset(mach_port_t bp, mach_port_t requestorport, mach_port_t *subsetportp) { - struct jobcb *js, *j = job_find_by_port(bp); + vproc_t js, j = job_find_by_port(bp); int bsdepth = 0; while ((j = job_parent(j)) != NULL) @@ -681,7 +681,7 @@ kern_return_t x_bootstrap_create_service(mach_port_t bp, name_t servicename, mach_port_t *serviceportp) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); struct machservice *ms; if (job_prog(j)[0] == '\0') { @@ -713,7 +713,7 @@ kern_return_t x_mpm_wait(mach_port_t bp, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); #if 0 struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); @@ -724,7 +724,7 @@ kern_return_t x_mpm_uncork_fork(mach_port_t bp, audit_token_t au_tok) { - struct jobcb *j = job_find_by_port(bp); + vproc_t j = job_find_by_port(bp); if (!j) return BOOTSTRAP_NOT_PRIVILEGED; @@ -740,7 +740,7 @@ uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, pid_t *child_pid, mach_port_t *obsvr_port) { - struct jobcb *jr, *j = job_find_by_port(bp); + vproc_t jr, j = job_find_by_port(bp); struct ldcred ldc; size_t offset = 0; char *tmpp; @@ -837,7 +837,7 @@ kern_return_t do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) { - struct jobcb *j = job_find_by_port(notify); + vproc_t j = job_find_by_port(notify); /* This message is sent to us when the last customer of one of our objects * goes away. @@ -886,7 +886,7 @@ } bool -trusted_client_check(struct jobcb *j, struct ldcred *ldc) +trusted_client_check(vproc_t j, struct ldcred *ldc) { static pid_t last_warned_pid = 0; Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 17:05:38 UTC (rev 22839) @@ -181,7 +181,7 @@ } void -ipc_open(int fd, struct jobcb *j) +ipc_open(int fd, vproc_t j) { struct conncb *c = calloc(1, sizeof(struct conncb)); @@ -324,7 +324,7 @@ { struct readmsg_context *rmc = context; launch_data_t resp = NULL; - struct jobcb *j; + vproc_t j; if (rmc->resp) return; Modified: trunk/launchd/src/launchd_unix_ipc.h =================================================================== --- trunk/launchd/src/launchd_unix_ipc.h 2006-09-06 16:34:59 UTC (rev 22838) +++ trunk/launchd/src/launchd_unix_ipc.h 2006-09-06 17:05:38 UTC (rev 22839) @@ -24,13 +24,13 @@ kq_callback kqconn_callback; SLIST_ENTRY(conncb) sle; launch_t conn; - struct jobcb *j; + vproc_t j; int disabled_batch:1, futureflags:31; }; extern char *sockpath; -void ipc_open(int fd, struct jobcb *j); +void ipc_open(int fd, vproc_t j); void ipc_close(struct conncb *c); void ipc_callback(void *, struct kevent *); void ipc_readmsg(launch_data_t msg, void *context); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/abd58c05/attachment.html From source_changes at macosforge.org Wed Sep 6 10:22:46 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:29 2007 Subject: [launchd-changes] [22840] trunk/launchd/src Message-ID: <20060906172246.8E17021BDDBF@cvs.opensource.apple.com> Revision: 22840 Author: zarzycki@apple.com Date: 2006-09-06 10:22:43 -0700 (Wed, 06 Sep 2006) Log Message: ----------- s,job_,vproc_,g Modified Paths: -------------- trunk/launchd/src/launchctl.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd.h trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchctl.c 2006-09-06 17:22:43 UTC (rev 22840) @@ -100,7 +100,7 @@ static int _fd(int); static int demux_cmd(int argc, char *const argv[]); static launch_data_t do_rendezvous_magic(const struct addrinfo *res, const char *serv); -static void submit_job_pass(launch_data_t jobs); +static void submit_vproc_pass(launch_data_t jobs); static void submit_mach_jobs(launch_data_t jobs); static void let_go_of_mach_jobs(launch_data_t jobs); static void do_mgroup_join(int fd, int family, int socktype, int protocol, const char *mgroup); @@ -484,7 +484,7 @@ { char ourhostname[1024]; launch_data_t tmpd, tmps, thejob, tmpa; - bool job_disabled = false; + bool vproc_disabled = false; size_t i, c; gethostname(ourhostname, sizeof(ourhostname)); @@ -560,12 +560,12 @@ } if ((tmpd = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_DISABLED))) - job_disabled = launch_data_get_bool(tmpd); + vproc_disabled = launch_data_get_bool(tmpd); if (lus->forceload) - job_disabled = false; + vproc_disabled = false; - if (job_disabled && lus->load) + if (vproc_disabled && lus->load) goto out_bad; if (delay_to_second_pass(thejob)) @@ -1395,10 +1395,10 @@ if (lus.load) { distill_jobs(lus.pass1); submit_mach_jobs(lus.pass0); - submit_job_pass(lus.pass1); + submit_vproc_pass(lus.pass1); let_go_of_mach_jobs(lus.pass0); distill_jobs(lus.pass2); - submit_job_pass(lus.pass2); + submit_vproc_pass(lus.pass2); } else { for (i = 0; i < launch_data_array_get_count(lus.pass1); i++) unloadjob(launch_data_array_get_index(lus.pass1, i)); @@ -1466,7 +1466,7 @@ } void -submit_job_pass(launch_data_t jobs) +submit_vproc_pass(launch_data_t jobs) { launch_data_t msg, resp; size_t i; Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd.c 2006-09-06 17:22:43 UTC (rev 22840) @@ -282,11 +282,11 @@ if (h) sprintf(ldconf, "%s/%s", h, LAUNCHD_CONF); - rlcj = job_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); + rlcj = vproc_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); launchd_assert(rlcj != NULL); if (argv[0]) - fbj = job_new(root_job, FIRSTBORN_LABEL, NULL, (const char *const *)argv, NULL, MACH_PORT_NULL); + fbj = vproc_new(root_job, FIRSTBORN_LABEL, NULL, (const char *const *)argv, NULL, MACH_PORT_NULL); if (NULL == getenv("PATH")) setenv("PATH", _PATH_STDPATH, 1); @@ -322,10 +322,10 @@ } if (stat(ldconf, &sb) == 0) - job_dispatch(rlcj, true); + vproc_dispatch(rlcj, true); if (fbj) - job_dispatch(fbj, true); + vproc_dispatch(fbj, true); pthread_attr_t attr; pthread_attr_init(&attr); @@ -337,7 +337,7 @@ mach_msg_return_t msgr; mach_msg_size_t mxmsgsz = sizeof(union MaxRequestSize) + MAX_TRAILER_SIZE; - if (getpid() == 1 && !job_active(rlcj)) + if (getpid() == 1 && !vproc_active(rlcj)) init_pre_kevent(); launchd_assert(setjmp(doom_doom_doom) == 0); @@ -401,7 +401,7 @@ } if (getpid() == 1) { - if (rlcj && job_active(rlcj)) + if (rlcj && vproc_active(rlcj)) goto out; init_pre_kevent(); } @@ -493,7 +493,7 @@ rlcj = NULL; - job_remove_all_inactive(root_job); + vproc_remove_all_inactive(root_job); if (getpid() == 1) catatonia(); @@ -528,7 +528,7 @@ switch (kev->ident) { case SIGHUP: if (rlcj) - job_dispatch(rlcj, true); + vproc_dispatch(rlcj, true); break; case SIGTERM: launchd_shutdown(); @@ -626,7 +626,7 @@ } void -batch_job_enable(bool e, struct conncb *c) +batch_vproc_enable(bool e, struct conncb *c) { if (e && c->disabled_batch) { batch_disabler_count--; @@ -701,7 +701,7 @@ if (new_networking_state != network_up) { network_up = new_networking_state; - job_dispatch_all_other_semaphores(root_job, NULL); + vproc_dispatch_all_other_semaphores(root_job, NULL); } } @@ -760,7 +760,7 @@ launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) { if (gc_this_job) { - job_remove(gc_this_job); + vproc_remove(gc_this_job); gc_this_job = NULL; } Modified: trunk/launchd/src/launchd.h =================================================================== --- trunk/launchd/src/launchd.h 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd.h 2006-09-06 17:22:43 UTC (rev 22840) @@ -57,7 +57,7 @@ bool init_check_pid(pid_t); int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); -void batch_job_enable(bool e, struct conncb *c); +void batch_vproc_enable(bool e, struct conncb *c); launch_data_t launchd_setstdio(int d, launch_data_t o); void launchd_SessionCreate(void); Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 17:22:43 UTC (rev 22840) @@ -173,7 +173,7 @@ struct vproc_s { - kq_callback kqjob_callback; + kq_callback kqvproc_callback; SLIST_ENTRY(vproc_s) sle; SLIST_HEAD(, socketgroup) sockets; SLIST_HEAD(, watchpath) vnodes; @@ -215,29 +215,29 @@ char label[0]; }; -static vproc_t job_import2(launch_data_t pload); -static void job_import_keys(launch_data_t obj, const char *key, void *context); -static void job_import_bool(vproc_t j, const char *key, bool value); -static void job_import_string(vproc_t j, const char *key, const char *value); -static void job_import_integer(vproc_t j, const char *key, long long value); -static void job_import_dictionary(vproc_t j, const char *key, launch_data_t value); -static void job_import_array(vproc_t j, const char *key, launch_data_t value); -static void job_watch(vproc_t j); -static void job_ignore(vproc_t j); -static void job_reap(vproc_t j); -static bool job_useless(vproc_t j); -static bool job_keepalive(vproc_t j); -static void job_start(vproc_t j); -static void job_start_child(vproc_t j, int execfd) __attribute__((noreturn)); -static void job_setup_attributes(vproc_t j); -static bool job_setup_machport(vproc_t j); -static void job_postfork_become_user(vproc_t j); -static void job_callback(void *obj, struct kevent *kev); -static pid_t job_fork(vproc_t j); -static size_t job_prep_log_preface(vproc_t j, char *buf); -static void job_setup_env_from_other_jobs(vproc_t j); -static void job_export_all2(vproc_t j, launch_data_t where); -static launch_data_t job_export2(vproc_t j, bool subjobs); +static vproc_t vproc_import2(launch_data_t pload); +static void vproc_import_keys(launch_data_t obj, const char *key, void *context); +static void vproc_import_bool(vproc_t j, const char *key, bool value); +static void vproc_import_string(vproc_t j, const char *key, const char *value); +static void vproc_import_integer(vproc_t j, const char *key, long long value); +static void vproc_import_dictionary(vproc_t j, const char *key, launch_data_t value); +static void vproc_import_array(vproc_t j, const char *key, launch_data_t value); +static void vproc_watch(vproc_t j); +static void vproc_ignore(vproc_t j); +static void vproc_reap(vproc_t j); +static bool vproc_useless(vproc_t j); +static bool vproc_keepalive(vproc_t j); +static void vproc_start(vproc_t j); +static void vproc_start_child(vproc_t j, int execfd) __attribute__((noreturn)); +static void vproc_setup_attributes(vproc_t j); +static bool vproc_setup_machport(vproc_t j); +static void vproc_postfork_become_user(vproc_t j); +static void vproc_callback(void *obj, struct kevent *kev); +static pid_t vproc_fork(vproc_t j); +static size_t vproc_prep_log_preface(vproc_t j, char *buf); +static void vproc_setup_env_from_other_jobs(vproc_t j); +static void vproc_export_all2(vproc_t j, launch_data_t where); +static launch_data_t vproc_export2(vproc_t j, bool subjobs); static const struct { @@ -279,7 +279,7 @@ } void -job_ignore(vproc_t j) +vproc_ignore(vproc_t j) { struct socketgroup *sg; struct machservice *ms; @@ -292,11 +292,11 @@ watchpath_ignore(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - job_assumes(j, launchd_mport_request_callback(ms->port, NULL, false) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_request_callback(ms->port, NULL, false) == KERN_SUCCESS); } void -job_watch(vproc_t j) +vproc_watch(vproc_t j) { struct socketgroup *sg; struct machservice *ms; @@ -309,24 +309,24 @@ watchpath_watch(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - job_assumes(j, launchd_mport_request_callback(ms->port, j, false) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_request_callback(ms->port, j, false) == KERN_SUCCESS); } void -job_stop(vproc_t j) +vproc_stop(vproc_t j) { if (j->p) kill(j->p, SIGTERM); } launch_data_t -job_export(vproc_t j) +vproc_export(vproc_t j) { - return job_export2(j, true); + return vproc_export2(j, true); } launch_data_t -job_export2(vproc_t j, bool subjobs) +vproc_export2(vproc_t j, bool subjobs) { launch_data_t tmp, tmp2, tmp3, r = launch_data_alloc(LAUNCH_DATA_DICTIONARY); @@ -407,7 +407,7 @@ size_t i = 0; SLIST_FOREACH(ji, &j->jobs, sle) { - tmp2 = job_export2(ji, true); + tmp2 = vproc_export2(ji, true); launch_data_array_set_index(tmp, tmp2, i); i++; } @@ -419,23 +419,23 @@ } void -job_remove_all_inactive(vproc_t j) +vproc_remove_all_inactive(vproc_t j) { vproc_t ji, jn; SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - job_remove_all_inactive(ji); + vproc_remove_all_inactive(ji); } - if (!job_active(j)) { - job_remove(j); + if (!vproc_active(j)) { + vproc_remove(j); } else if (getpid() != 1) { - job_stop(j); + vproc_stop(j); } } void -job_remove(vproc_t j) +vproc_remove(vproc_t j) { vproc_t ji; struct calendarinterval *ci; @@ -446,15 +446,15 @@ struct machservice *ms; struct semaphoreitem *si; - job_log(j, LOG_DEBUG, "Removed"); + vproc_log(j, LOG_DEBUG, "Removed"); if (j->p) { if (kevent_mod(j->p, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &kqsimple_zombie_reaper) == -1) { - job_reap(j); + vproc_reap(j); } else { /* we've attached the simple zombie reaper, we're going to delete the job before it is dead */ total_children--; - job_stop(j); + vproc_stop(j); } } @@ -462,18 +462,18 @@ SLIST_REMOVE(&j->parent->jobs, j, vproc_s, sle); if (j->execfd) - job_assumes(j, close(j->execfd) == 0); + vproc_assumes(j, close(j->execfd) == 0); if (j->bs_port) { if (j->transfer_bstrap) { - job_assumes(j, launchd_mport_deallocate(j->bs_port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_deallocate(j->bs_port) == KERN_SUCCESS); } else { - job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); } } if (j->req_port) - job_assumes(j, launchd_mport_deallocate(j->req_port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_deallocate(j->req_port) == KERN_SUCCESS); #if 0 if (j->wait_reply_port) { @@ -481,7 +481,7 @@ #endif while ((ji = SLIST_FIRST(&j->jobs))) - job_remove(ji); + vproc_remove(ji); while ((sg = SLIST_FIRST(&j->sockets))) socketgroup_delete(j, sg); @@ -569,39 +569,39 @@ } bool -job_setup_machport(vproc_t j) +vproc_setup_machport(vproc_t j) { - if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) goto out_bad; - if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) goto out_bad2; return true; out_bad2: - job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); out_bad: return false; } vproc_t -job_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond) +vproc_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond) { const char **argv = (const char **)mach_cmd2argv(cmd); vproc_t j = NULL; char buf[1000]; - if (!job_assumes(jbs, argv != NULL)) + if (!vproc_assumes(jbs, argv != NULL)) goto out_bad; /* preflight the string so we know how big it is */ sprintf(buf, "100000.%s", basename((char *)argv[0])); - j = job_new(jbs, buf, NULL, argv, NULL, MACH_PORT_NULL); + j = vproc_new(jbs, buf, NULL, argv, NULL, MACH_PORT_NULL); free(argv); - if (!job_assumes(jbs, j != NULL)) + if (!vproc_assumes(jbs, j != NULL)) goto out_bad; j->mach_uid = uid; @@ -609,28 +609,28 @@ j->legacy_mach_job = true; j->priv_port_has_senders = true; /* the IPC that called us will make-send on this port */ - if (!job_setup_machport(j)) + if (!vproc_setup_machport(j)) goto out_bad; - if (!job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS)) { - job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + if (!vproc_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS)) { + vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); goto out_bad; } sprintf(j->label, "%d.%s", MACH_PORT_INDEX(j->bs_port), basename(j->argv[0])); - job_log(j, LOG_INFO, "New%s server in bootstrap: %x", ond ? " on-demand" : "", jbs->bs_port); + vproc_log(j, LOG_INFO, "New%s server in bootstrap: %x", ond ? " on-demand" : "", jbs->bs_port); return j; out_bad: if (j) - job_remove(j); + vproc_remove(j); return NULL; } kern_return_t -job_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus) +vproc_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus) { if (j->p) { j->wait_reply_port = srp; @@ -643,16 +643,16 @@ } vproc_t -job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc) +vproc_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc) { vproc_t jr; - if ((jr = job_find(root_job, label)) != NULL) { + if ((jr = vproc_find(root_job, label)) != NULL) { errno = EEXIST; return NULL; } - jr = job_new(root_job, label, path, argv, NULL, MACH_PORT_NULL); + jr = vproc_new(root_job, label, path, argv, NULL, MACH_PORT_NULL); if (!jr) return NULL; @@ -661,8 +661,8 @@ jr->stall_before_exec = w4d; jr->force_ppc = fppc; - if (!job_setup_machport(jr)) { - job_remove(jr); + if (!vproc_setup_machport(jr)) { + vproc_remove(jr); return NULL; } @@ -677,7 +677,7 @@ if (env) for (; *env; env++) { char newkey[strlen(*env) + 1], *eqoff = strchr(*env, '='); if (!eqoff) { - job_log(jr, LOG_WARNING, "Environmental variable missing '=' separator: %s", *env); + vproc_log(jr, LOG_WARNING, "Environmental variable missing '=' separator: %s", *env); continue; } strcpy(newkey, *env); @@ -685,13 +685,13 @@ envitem_new(jr, newkey, eqoff + 1, false); } - job_dispatch(jr, true); + vproc_dispatch(jr, true); return jr; } vproc_t -job_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) +vproc_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) { const char *const *argv_tmp = argv; char *co; @@ -705,31 +705,31 @@ j = calloc(1, sizeof(struct vproc_s) + strlen(label) + 1); - if (!job_assumes(p, j != NULL)) + if (!vproc_assumes(p, j != NULL)) goto out_bad; strcpy(j->label, label); - j->kqjob_callback = job_callback; - j->parent = p ? job_get_bs(p) : NULL; + j->kqvproc_callback = vproc_callback; + j->parent = p ? vproc_get_bs(p) : NULL; j->ondemand = true; j->checkedin = true; j->firstborn = (strcmp(label, FIRSTBORN_LABEL) == 0); if (reqport != MACH_PORT_NULL) { j->req_port = reqport; - if (!job_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) goto out_bad; } if (prog) { j->prog = strdup(prog); - if (!job_assumes(j, j->prog != NULL)) + if (!vproc_assumes(j, j->prog != NULL)) goto out_bad; } if (stdinpath) { j->stdinpath = strdup(stdinpath); - if (!job_assumes(j, j->stdinpath != NULL)) + if (!vproc_assumes(j, j->stdinpath != NULL)) goto out_bad; } @@ -742,7 +742,7 @@ j->argv = malloc((j->argc + 1) * sizeof(char *) + cc); - if (!job_assumes(j, j->argv != NULL)) + if (!vproc_assumes(j, j->argv != NULL)) goto out_bad; co = ((char *)j->argv) + ((j->argc + 1) * sizeof(char *)); @@ -757,7 +757,7 @@ if (j->parent) { SLIST_INSERT_HEAD(&j->parent->jobs, j, sle); - job_log(j->parent, LOG_DEBUG, "Conceived"); + vproc_log(j->parent, LOG_DEBUG, "Conceived"); } return j; @@ -774,20 +774,20 @@ } vproc_t -job_import(launch_data_t pload) +vproc_import(launch_data_t pload) { - vproc_t j = job_import2(pload); + vproc_t j = vproc_import2(pload); if (j == NULL) return NULL; - job_dispatch(j, false); + vproc_dispatch(j, false); return j; } launch_data_t -job_import_bulk(launch_data_t pload) +vproc_import_bulk(launch_data_t pload) { launch_data_t resp = launch_data_alloc(LAUNCH_DATA_ARRAY); vproc_t *ja; @@ -796,7 +796,7 @@ ja = alloca(c * sizeof(vproc_t )); for (i = 0; i < c; i++) { - if ((ja[i] = job_import2(launch_data_array_get_index(pload, i)))) + if ((ja[i] = vproc_import2(launch_data_array_get_index(pload, i)))) errno = 0; launch_data_array_set_index(resp, launch_data_new_errno(errno), i); } @@ -804,14 +804,14 @@ for (i = 0; i < c; i++) { if (ja[i] == NULL) continue; - job_dispatch(ja[i], false); + vproc_dispatch(ja[i], false); } return resp; } void -job_import_bool(vproc_t j, const char *key, bool value) +vproc_import_bool(vproc_t j, const char *key, bool value) { switch (key[0]) { case 'f': @@ -848,7 +848,7 @@ case 'I': if (strcasecmp(key, LAUNCH_JOBKEY_INITGROUPS) == 0) { if (getuid() == 0) { - job_log(j, LOG_WARNING, "Ignored this key: %s", key); + vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } j->no_init_groups = !value; @@ -875,7 +875,7 @@ } void -job_import_string(vproc_t j, const char *key, const char *value) +vproc_import_string(vproc_t j, const char *key, const char *value) { char **where2put = NULL; @@ -894,7 +894,7 @@ case 'R': if (strcasecmp(key, LAUNCH_JOBKEY_ROOTDIRECTORY) == 0) { if (getuid() != 0) { - job_log(j, LOG_WARNING, "Ignored this key: %s", key); + vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->rootdir; @@ -909,7 +909,7 @@ case 'U': if (strcasecmp(key, LAUNCH_JOBKEY_USERNAME) == 0) { if (getuid() != 0 || strcmp(value, "root") == 0) { - job_log(j, LOG_WARNING, "Ignored this key: %s", key); + vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->username; @@ -919,7 +919,7 @@ case 'G': if (strcasecmp(key, LAUNCH_JOBKEY_GROUPNAME) == 0) { if (getuid() != 0 || strcmp(value, "wheel") == 0) { - job_log(j, LOG_WARNING, "Ignored this key: %s", key); + vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->groupname; @@ -938,14 +938,14 @@ } if (where2put) { - job_assumes(j, (*where2put = strdup(value)) != NULL); + vproc_assumes(j, (*where2put = strdup(value)) != NULL); } else { - job_log(j, LOG_WARNING, "Unknown key: %s", key); + vproc_log(j, LOG_WARNING, "Unknown key: %s", key); } } void -job_import_integer(vproc_t j, const char *key, long long value) +vproc_import_integer(vproc_t j, const char *key, long long value) { switch (key[0]) { case 'n': @@ -957,7 +957,7 @@ case 'T': if (strcasecmp(key, LAUNCH_JOBKEY_TIMEOUT) == 0) { if (value <= 0) - job_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); + vproc_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); else j->timeout = value; } @@ -973,11 +973,11 @@ case 'S': if (strcasecmp(key, LAUNCH_JOBKEY_STARTINTERVAL) == 0) { if (value <= 0) - job_log(j, LOG_WARNING, "StartInterval is not greater than zero, ignoring"); + vproc_log(j, LOG_WARNING, "StartInterval is not greater than zero, ignoring"); else j->start_interval = value; if (-1 == kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, value, j)) - job_log_error(j, LOG_ERR, "adding kevent timer"); + vproc_log_error(j, LOG_ERR, "adding kevent timer"); } break; default: @@ -986,7 +986,7 @@ } void -job_import_dictionary(vproc_t j, const char *key, launch_data_t value) +vproc_import_dictionary(vproc_t j, const char *key, launch_data_t value) { launch_data_t tmp; @@ -1040,7 +1040,7 @@ if (strcasecmp(key, LAUNCH_JOBKEY_MACHSERVICES) == 0) { launch_data_dict_iterate(value, machservice_setup, j); if (!SLIST_EMPTY(&j->machservices)) - job_setup_machport(j); + vproc_setup_machport(j); } break; default: @@ -1049,7 +1049,7 @@ } void -job_import_array(vproc_t j, const char *key, launch_data_t value) +vproc_import_array(vproc_t j, const char *key, launch_data_t value) { bool is_q_dir = false; bool is_wp = false; @@ -1095,7 +1095,7 @@ } void -job_import_keys(launch_data_t obj, const char *key, void *context) +vproc_import_keys(launch_data_t obj, const char *key, void *context) { vproc_t j = context; launch_data_type_t kind; @@ -1107,28 +1107,28 @@ switch (kind) { case LAUNCH_DATA_BOOL: - job_import_bool(j, key, launch_data_get_bool(obj)); + vproc_import_bool(j, key, launch_data_get_bool(obj)); break; case LAUNCH_DATA_STRING: - job_import_string(j, key, launch_data_get_string(obj)); + vproc_import_string(j, key, launch_data_get_string(obj)); break; case LAUNCH_DATA_INTEGER: - job_import_integer(j, key, launch_data_get_integer(obj)); + vproc_import_integer(j, key, launch_data_get_integer(obj)); break; case LAUNCH_DATA_DICTIONARY: - job_import_dictionary(j, key, obj); + vproc_import_dictionary(j, key, obj); break; case LAUNCH_DATA_ARRAY: - job_import_array(j, key, obj); + vproc_import_array(j, key, obj); break; default: - job_log(j, LOG_WARNING, "Unknown value type '%d' for key: %s", kind, key); + vproc_log(j, LOG_WARNING, "Unknown value type '%d' for key: %s", kind, key); break; } } vproc_t -job_import2(launch_data_t pload) +vproc_import2(launch_data_t pload) { launch_data_t tmp, ldpa; const char *label = NULL, *prog = NULL; @@ -1154,7 +1154,7 @@ if (label == NULL) { errno = EINVAL; return NULL; - } else if ((j = job_find(root_job, label)) != NULL) { + } else if ((j = vproc_find(root_job, label)) != NULL) { errno = EEXIST; return NULL; } else if (label[0] == '\0' || (strncasecmp(label, "", strlen("com.apple.launchd")) == 0) || @@ -1175,14 +1175,14 @@ argv[i] = NULL; } - if ((j = job_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) - launch_data_dict_iterate(pload, job_import_keys, j); + if ((j = vproc_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) + launch_data_dict_iterate(pload, vproc_import_keys, j); return j; } vproc_t -job_find(vproc_t j, const char *label) +vproc_find(vproc_t j, const char *label) { vproc_t jr, ji; @@ -1193,7 +1193,7 @@ return j; SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = job_find(ji, label))) + if ((jr = vproc_find(ji, label))) return jr; } @@ -1202,7 +1202,7 @@ } vproc_t -job_find_by_pid(vproc_t j, pid_t p) +vproc_find_by_pid(vproc_t j, pid_t p) { vproc_t jr, ji; @@ -1210,7 +1210,7 @@ return j; SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = job_find_by_pid(ji, p))) + if ((jr = vproc_find_by_pid(ji, p))) return jr; } @@ -1219,48 +1219,48 @@ } void -job_export_all2(vproc_t j, launch_data_t where) +vproc_export_all2(vproc_t j, launch_data_t where) { launch_data_t tmp; vproc_t ji; - if (job_assumes(j, (tmp = job_export2(j, false)) != NULL)) + if (vproc_assumes(j, (tmp = vproc_export2(j, false)) != NULL)) launch_data_dict_insert(where, tmp, j->label); SLIST_FOREACH(ji, &j->jobs, sle) - job_export_all2(ji, where); + vproc_export_all2(ji, where); } launch_data_t -job_export_all(void) +vproc_export_all(void) { launch_data_t resp = launch_data_alloc(LAUNCH_DATA_DICTIONARY); - job_export_all2(root_job, resp); + vproc_export_all2(root_job, resp); return resp; } void -job_reap(vproc_t j) +vproc_reap(vproc_t j) { struct rusage ru; int status; - job_log(j, LOG_DEBUG, "Reaping"); + vproc_log(j, LOG_DEBUG, "Reaping"); if (j->execfd) { - job_assumes(j, close(j->execfd) == 0); + vproc_assumes(j, close(j->execfd) == 0); j->execfd = 0; } - if (!job_assumes(j, wait4(j->p, &status, 0, &ru) != -1)) { + if (!vproc_assumes(j, wait4(j->p, &status, 0, &ru) != -1)) { return; } if (j->wait_reply_port) { - job_log(j, LOG_DEBUG, "MPM wait reply being sent"); - job_assumes(j, mpm_wait_reply(j->wait_reply_port, 0, status) == 0); + vproc_log(j, LOG_DEBUG, "MPM wait reply being sent"); + vproc_assumes(j, mpm_wait_reply(j->wait_reply_port, 0, status) == 0); j->wait_reply_port = MACH_PORT_NULL; } @@ -1282,15 +1282,15 @@ j->ru.ru_nivcsw += ru.ru_nivcsw; if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { - job_log(j, LOG_WARNING, "exited with exit code: %d", WEXITSTATUS(status)); + vproc_log(j, LOG_WARNING, "exited with exit code: %d", WEXITSTATUS(status)); } if (WIFSIGNALED(status)) { int s = WTERMSIG(status); if (SIGKILL == s || SIGTERM == s) { - job_log(j, LOG_NOTICE, "Exited: %s", strsignal(s)); + vproc_log(j, LOG_NOTICE, "Exited: %s", strsignal(s)); } else { - job_log(j, LOG_WARNING, "Exited abnormally: %s", strsignal(s)); + vproc_log(j, LOG_WARNING, "Exited abnormally: %s", strsignal(s)); } } @@ -1300,7 +1300,7 @@ } void -job_dispatch(vproc_t j, bool kickstart) +vproc_dispatch(vproc_t j, bool kickstart) { /* * The whole job removal logic needs to be consolidated. The fact that @@ -1310,19 +1310,19 @@ * * This is a classic example. The act of dispatching a job may delete it. */ - if (job_active(j)) { + if (vproc_active(j)) { return; - } else if (job_useless(j)) { - job_remove(j); - } else if (kickstart || job_keepalive(j)) { - job_start(j); + } else if (vproc_useless(j)) { + vproc_remove(j); + } else if (kickstart || vproc_keepalive(j)) { + vproc_start(j); } else { - job_watch(j); + vproc_watch(j); } } void -job_callback(void *obj, struct kevent *kev) +vproc_callback(void *obj, struct kevent *kev) { vproc_t j = obj; bool d = j->debug; @@ -1334,18 +1334,18 @@ switch (kev->filter) { case EVFILT_PROC: - job_reap(j); + vproc_reap(j); if (j->firstborn) { - job_log(j, LOG_DEBUG, "first born died, begin shutdown"); + vproc_log(j, LOG_DEBUG, "first born died, begin shutdown"); launchd_shutdown(); } else { - job_dispatch(j, false); + vproc_dispatch(j, false); } break; case EVFILT_TIMER: if ((uintptr_t)j == kev->ident || (uintptr_t)&j->start_interval == kev->ident) { - job_dispatch(j, true); + vproc_dispatch(j, true); } else { calendarinterval_callback(j, kev); } @@ -1360,38 +1360,38 @@ } if (j->wait4debugger) { /* Allow somebody else to attach */ - job_assumes(j, kill(j->p, SIGSTOP) != -1); - job_assumes(j, ptrace(PT_DETACH, j->p, NULL, 0) != -1); + vproc_assumes(j, kill(j->p, SIGSTOP) != -1); + vproc_assumes(j, ptrace(PT_DETACH, j->p, NULL, 0) != -1); } if (kev->data > 0) { int e; read(j->execfd, &e, sizeof(e)); errno = e; - job_log_error(j, LOG_ERR, "execve()"); - job_remove(j); + vproc_log_error(j, LOG_ERR, "execve()"); + vproc_remove(j); j = NULL; } else { - job_assumes(j, close(j->execfd) == 0); + vproc_assumes(j, close(j->execfd) == 0); j->execfd = 0; } break; case EVFILT_MACHPORT: - job_dispatch(j, true); + vproc_dispatch(j, true); break; default: - job_assumes(j, false); + vproc_assumes(j, false); break; } if (d) { - /* the job might have been removed, must not call job_log() */ + /* the job might have been removed, must not call vproc_log() */ setlogmask(oldmask); } } void -job_start(vproc_t j) +vproc_start(vproc_t j) { int spair[2]; int execspair[2]; @@ -1400,14 +1400,14 @@ bool sipc = false; time_t td; - if (!job_assumes(j, j->req_port == MACH_PORT_NULL)) + if (!vproc_assumes(j, j->req_port == MACH_PORT_NULL)) return; - if (!job_assumes(j, j->parent != NULL)) + if (!vproc_assumes(j, j->parent != NULL)) return; - if (job_active(j)) { - job_log(j, LOG_DEBUG, "Already started"); + if (vproc_active(j)) { + vproc_log(j, LOG_DEBUG, "Already started"); return; } @@ -1416,12 +1416,12 @@ if (td < LAUNCHD_MIN_JOB_RUN_TIME) { time_t respawn_delta = LAUNCHD_MIN_JOB_RUN_TIME - td; - job_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); - job_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); + vproc_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); + vproc_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); return; } - job_log(j, LOG_DEBUG, "Starting"); + vproc_log(j, LOG_DEBUG, "Starting"); if (!j->legacy_mach_job) sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); @@ -1440,57 +1440,57 @@ time(&j->start_time); if (j->bs_port) { - job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS); } - switch (c = job_fork(j->bs_port ? j : j->parent)) { + switch (c = vproc_fork(j->bs_port ? j : j->parent)) { case -1: - job_log_error(j, LOG_ERR, "fork() failed, will try again in one second"); - job_assumes(j, close(execspair[0]) == 0); - job_assumes(j, close(execspair[1]) == 0); + vproc_log_error(j, LOG_ERR, "fork() failed, will try again in one second"); + vproc_assumes(j, close(execspair[0]) == 0); + vproc_assumes(j, close(execspair[1]) == 0); if (sipc) { - job_assumes(j, close(spair[0]) == 0); - job_assumes(j, close(spair[1]) == 0); + vproc_assumes(j, close(spair[0]) == 0); + vproc_assumes(j, close(spair[1]) == 0); } break; case 0: - job_assumes(j, close(execspair[0]) == 0); + vproc_assumes(j, close(execspair[0]) == 0); /* wait for our parent to say they've attached a kevent to us */ read(_fd(execspair[1]), &c, sizeof(c)); if (j->firstborn) { setpgid(getpid(), getpid()); if (isatty(STDIN_FILENO)) { if (tcsetpgrp(STDIN_FILENO, getpid()) == -1) - job_log_error(j, LOG_WARNING, "tcsetpgrp()"); + vproc_log_error(j, LOG_WARNING, "tcsetpgrp()"); } } if (sipc) { - job_assumes(j, close(spair[0]) == 0); + vproc_assumes(j, close(spair[0]) == 0); sprintf(nbuf, "%d", spair[1]); setenv(LAUNCHD_TRUSTED_FD_ENV, nbuf, 1); } - job_start_child(j, execspair[1]); + vproc_start_child(j, execspair[1]); break; default: if (!SLIST_EMPTY(&j->machservices)) j->priv_port_has_senders = true; j->p = c; total_children++; - job_assumes(j, close(execspair[1]) == 0); + vproc_assumes(j, close(execspair[1]) == 0); j->execfd = _fd(execspair[0]); if (sipc) { - job_assumes(j, close(spair[1]) == 0); + vproc_assumes(j, close(spair[1]) == 0); ipc_open(_fd(spair[0]), j); } - if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqjob_callback) == -1) - job_log_error(j, LOG_ERR, "kevent_mod(j->execfd): %m"); - if (kevent_mod(c, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &j->kqjob_callback) == -1) { - job_log_error(j, LOG_ERR, "kevent()"); - job_reap(j); + if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqvproc_callback) == -1) + vproc_log_error(j, LOG_ERR, "kevent_mod(j->execfd): %m"); + if (kevent_mod(c, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &j->kqvproc_callback) == -1) { + vproc_log_error(j, LOG_ERR, "kevent()"); + vproc_reap(j); } else { if (j->ondemand) - job_ignore(j); + vproc_ignore(j); } if (!j->stall_before_exec) { @@ -1503,7 +1503,7 @@ } void -job_start_child(vproc_t j, int execfd) +vproc_start_child(vproc_t j, int execfd) { const char *file2exec = "/usr/libexec/launchproxy"; const char **argv; @@ -1511,7 +1511,7 @@ glob_t g; int i; - job_setup_attributes(j); + vproc_setup_attributes(j); if (j->argv && j->globargv) { g.gl_offs = 1; @@ -1519,7 +1519,7 @@ if (i > 0) gflags |= GLOB_APPEND; if (glob(j->argv[i], gflags, NULL, &g) != 0) { - job_log_error(j, LOG_ERR, "glob(\"%s\")", j->argv[i]); + vproc_log_error(j, LOG_ERR, "glob(\"%s\")", j->argv[i]); exit(EXIT_FAILURE); } } @@ -1542,42 +1542,42 @@ argv++; if (j->wait4debugger && ptrace(PT_TRACE_ME, getpid(), NULL, 0) == -1) - job_log_error(j, LOG_ERR, "ptrace(PT_TRACE_ME, ...)"); + vproc_log_error(j, LOG_ERR, "ptrace(PT_TRACE_ME, ...)"); if (j->force_ppc) { int affinmib[] = { CTL_KERN, KERN_AFFINITY, 1, 1 }; size_t mibsz = sizeof(affinmib) / sizeof(affinmib[0]); if (sysctl(affinmib, mibsz, NULL, NULL, NULL, 0) == -1) - job_log_error(j, LOG_WARNING, "Failed to force PowerPC execution"); + vproc_log_error(j, LOG_WARNING, "Failed to force PowerPC execution"); } if (j->prog) { execv(j->inetcompat ? file2exec : j->prog, (char *const*)argv); - job_log_error(j, LOG_ERR, "execv(\"%s\", ...)", j->prog); + vproc_log_error(j, LOG_ERR, "execv(\"%s\", ...)", j->prog); } else { execvp(j->inetcompat ? file2exec : argv[0], (char *const*)argv); - job_log_error(j, LOG_ERR, "execvp(\"%s\", ...)", argv[0]); + vproc_log_error(j, LOG_ERR, "execvp(\"%s\", ...)", argv[0]); } write(execfd, &errno, sizeof(errno)); exit(EXIT_FAILURE); } -void job_setup_env_from_other_jobs(vproc_t j) +void vproc_setup_env_from_other_jobs(vproc_t j) { struct envitem *ei; vproc_t ji; SLIST_FOREACH(ji, &j->jobs, sle) - job_setup_env_from_other_jobs(ji); + vproc_setup_env_from_other_jobs(ji); SLIST_FOREACH(ei, &j->global_env, sle) setenv(ei->key, ei->value, 1); } void -job_postfork_become_user(vproc_t j) +vproc_postfork_become_user(vproc_t j) { char loginname[2000]; struct passwd *pwe; @@ -1589,12 +1589,12 @@ if (j->username) { if ((pwe = getpwnam(j->username)) == NULL) { - job_log(j, LOG_ERR, "getpwnam(\"%s\") failed", j->username); + vproc_log(j, LOG_ERR, "getpwnam(\"%s\") failed", j->username); _exit(EXIT_FAILURE); } } else if (j->mach_uid) { if ((pwe = getpwuid(j->mach_uid)) == NULL) { - job_log(j, LOG_ERR, "getpwuid(\"%u\") failed", j->mach_uid); + vproc_log(j, LOG_ERR, "getpwuid(\"%u\") failed", j->mach_uid); _exit(EXIT_FAILURE); } } else { @@ -1604,7 +1604,7 @@ strlcpy(loginname, pwe->pw_name, sizeof(loginname)); if (pwe->pw_expire && time(NULL) >= pwe->pw_expire) { - job_log(j, LOG_ERR, "Expired account"); + vproc_log(j, LOG_ERR, "Expired account"); _exit(EXIT_FAILURE); } @@ -1615,7 +1615,7 @@ struct group *gre; if ((gre = getgrnam(j->groupname)) == NULL) { - job_log(j, LOG_ERR, "getgrnam(\"%s\") failed", j->groupname); + vproc_log(j, LOG_ERR, "getgrnam(\"%s\") failed", j->groupname); _exit(EXIT_FAILURE); } @@ -1623,7 +1623,7 @@ } if (-1 == setgid(desired_gid)) { - job_log_error(j, LOG_ERR, "setgid(%u)", desired_gid); + vproc_log_error(j, LOG_ERR, "setgid(%u)", desired_gid); _exit(EXIT_FAILURE); } @@ -1633,19 +1633,19 @@ if (!j->no_init_groups) { if (initgroups(loginname, desired_gid) == -1) { - job_log_error(j, LOG_ERR, "initgroups()"); + vproc_log_error(j, LOG_ERR, "initgroups()"); _exit(EXIT_FAILURE); } } if (-1 == setuid(desired_uid)) { - job_log_error(j, LOG_ERR, "setuid(%u)", desired_uid); + vproc_log_error(j, LOG_ERR, "setuid(%u)", desired_uid); _exit(EXIT_FAILURE); } } void -job_setup_attributes(vproc_t j) +vproc_setup_attributes(vproc_t j) { struct limititem *li; struct envitem *ei; @@ -1656,7 +1656,7 @@ struct rlimit rl; if (getrlimit(li->which, &rl) == -1) { - job_log_error(j, LOG_WARNING, "getrlimit()"); + vproc_log_error(j, LOG_WARNING, "getrlimit()"); continue; } @@ -1666,7 +1666,7 @@ rl.rlim_cur = li->lim.rlim_cur; if (setrlimit(li->which, &rl) == -1) - job_log_error(j, LOG_WARNING, "setrlimit()"); + vproc_log_error(j, LOG_WARNING, "setrlimit()"); } if (!j->inetcompat && j->session_create) @@ -1674,7 +1674,7 @@ if (j->low_pri_io) { if (setiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_PROCESS, IOPOL_THROTTLE) == -1) { - job_log_error(j, LOG_WARNING, "setiopolicy_np()"); + vproc_log_error(j, LOG_WARNING, "setiopolicy_np()"); } } if (j->rootdir) { @@ -1682,7 +1682,7 @@ chdir("."); } - job_postfork_become_user(j); + vproc_postfork_become_user(j); if (j->workingdir) { chdir(j->workingdir); @@ -1695,32 +1695,32 @@ if (j->stdinpath) { int sifd = open(j->stdinpath, O_RDONLY|O_NOCTTY); if (sifd == -1) { - job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdinpath); + vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdinpath); } else { - job_assumes(j, dup2(sifd, STDIN_FILENO) != -1); - job_assumes(j, close(sifd) == 0); + vproc_assumes(j, dup2(sifd, STDIN_FILENO) != -1); + vproc_assumes(j, close(sifd) == 0); } } if (j->stdoutpath) { int sofd = open(j->stdoutpath, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, DEFFILEMODE); if (sofd == -1) { - job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdoutpath); + vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdoutpath); } else { - job_assumes(j, dup2(sofd, STDOUT_FILENO) != -1); - job_assumes(j, close(sofd) == 0); + vproc_assumes(j, dup2(sofd, STDOUT_FILENO) != -1); + vproc_assumes(j, close(sofd) == 0); } } if (j->stderrpath) { int sefd = open(j->stderrpath, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, DEFFILEMODE); if (sefd == -1) { - job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stderrpath); + vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stderrpath); } else { - job_assumes(j, dup2(sefd, STDERR_FILENO) != -1); - job_assumes(j, close(sefd) == 0); + vproc_assumes(j, dup2(sefd, STDERR_FILENO) != -1); + vproc_assumes(j, close(sefd) == 0); } } - job_setup_env_from_other_jobs(root_job); + vproc_setup_env_from_other_jobs(root_job); SLIST_FOREACH(ei, &j->env, sle) setenv(ei->key, ei->value, 1); @@ -1745,7 +1745,7 @@ } } - job_assumes(j, closedir(dd) == 0); + vproc_assumes(j, closedir(dd) == 0); return r; } @@ -1767,14 +1767,14 @@ } if (-1 == kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_ADD, NOTE_ABSOLUTE|NOTE_SECONDS, later, j)) { - job_log_error(j, LOG_ERR, "adding kevent alarm"); + vproc_log_error(j, LOG_ERR, "adding kevent alarm"); } else { - job_log(j, LOG_INFO, "scheduled to run again at %s", ctime(&later)); + vproc_log(j, LOG_INFO, "scheduled to run again at %s", ctime(&later)); } } size_t -job_prep_log_preface(vproc_t j, char *buf) +vproc_prep_log_preface(vproc_t j, char *buf) { size_t lsz = strlen(j->label); char newlabel[lsz * 2 + 1]; @@ -1792,13 +1792,13 @@ newlabel[o] = '\0'; if (j->parent) - r = job_prep_log_preface(j->parent, buf); + r = vproc_prep_log_preface(j->parent, buf); return r + sprintf(buf + r, "%s%s", j->parent ? "/" : "", newlabel); } void -job_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test) +vproc_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test) { int saved_errno = errno; char buf[100]; @@ -1820,17 +1820,17 @@ *rcs_rev_tmp = '\0'; } - job_log(j, LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); + vproc_log(j, LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); } void -job_log_error(vproc_t j, int pri, const char *msg, ...) +vproc_log_error(vproc_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; size_t o; - o = job_prep_log_preface(j, newmsg); + o = vproc_prep_log_preface(j, newmsg); sprintf(newmsg + o, ": %s: %s", msg, strerror(errno)); @@ -1840,13 +1840,13 @@ } void -job_log(vproc_t j, int pri, const char *msg, ...) +vproc_log(vproc_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; size_t o; - o = job_prep_log_preface(j, newmsg); + o = vproc_prep_log_preface(j, newmsg); sprintf(newmsg + o, ": %s", msg); @@ -1860,7 +1860,7 @@ { struct watchpath *wp = calloc(1, sizeof(struct watchpath) + strlen(name) + 1); - if (!job_assumes(j, wp != NULL)) + if (!vproc_assumes(j, wp != NULL)) return false; wp->is_qdir = qdir; @@ -1878,7 +1878,7 @@ watchpath_delete(vproc_t j, struct watchpath *wp) { if (wp->fd != -1) - job_assumes(j, close(wp->fd) != -1); + vproc_assumes(j, close(wp->fd) != -1); SLIST_REMOVE(&j->vnodes, wp, watchpath, sle); @@ -1889,8 +1889,8 @@ watchpath_ignore(vproc_t j, struct watchpath *wp) { if (wp->fd != -1) { - job_log(j, LOG_DEBUG, "Ignoring Vnode: %d", wp->fd); - job_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_DELETE, 0, 0, NULL) != -1); + vproc_log(j, LOG_DEBUG, "Ignoring Vnode: %d", wp->fd); + vproc_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_DELETE, 0, 0, NULL) != -1); } } @@ -1907,18 +1907,18 @@ wp->fd = _fd(open(wp->name, O_EVTONLY|O_NOCTTY|O_NOFOLLOW)); if (wp->fd == -1) - return job_log_error(j, LOG_ERR, "Watchpath monitoring failed on \"%s\"", wp->name); + return vproc_log_error(j, LOG_ERR, "Watchpath monitoring failed on \"%s\"", wp->name); - job_log(j, LOG_DEBUG, "Watching Vnode: %d", wp->fd); - job_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, fflags, 0, j) != -1); + vproc_log(j, LOG_DEBUG, "Watching Vnode: %d", wp->fd); + vproc_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, fflags, 0, j) != -1); if (!wp->is_qdir) return; if (-1 == (qdir_file_cnt = dir_has_files(j, wp->name))) { - job_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); + vproc_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); } else if (qdir_file_cnt > 0) { - job_dispatch(j, true); + vproc_dispatch(j, true); } } @@ -1933,26 +1933,26 @@ break; } - job_assumes(j, wp != NULL); + vproc_assumes(j, wp != NULL); if ((NOTE_DELETE|NOTE_RENAME|NOTE_REVOKE) & kev->fflags) { - job_log(j, LOG_DEBUG, "Path invalidated: %s", wp->name); - job_assumes(j, close(wp->fd) == 0); + vproc_log(j, LOG_DEBUG, "Path invalidated: %s", wp->name); + vproc_assumes(j, close(wp->fd) == 0); wp->fd = -1; /* this will get fixed in watchpath_watch() */ } else if (!wp->is_qdir) { - job_log(j, LOG_DEBUG, "Watch path modified: %s", wp->name); + vproc_log(j, LOG_DEBUG, "Watch path modified: %s", wp->name); } else { - job_log(j, LOG_DEBUG, "Queue directory modified: %s", wp->name); + vproc_log(j, LOG_DEBUG, "Queue directory modified: %s", wp->name); if (-1 == (dir_file_cnt = dir_has_files(j, wp->name))) { - job_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); + vproc_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); } else if (0 == dir_file_cnt) { - job_log(j, LOG_DEBUG, "Spurious wake up, directory is empty again: %s", wp->name); + vproc_log(j, LOG_DEBUG, "Spurious wake up, directory is empty again: %s", wp->name); return; } } - job_dispatch(j, true); + vproc_dispatch(j, true); } bool @@ -1991,7 +1991,7 @@ { struct calendarinterval *ci = calloc(1, sizeof(struct calendarinterval)); - if (!job_assumes(j, ci != NULL)) + if (!vproc_assumes(j, ci != NULL)) return false; ci->when = *w; @@ -2006,7 +2006,7 @@ void calendarinterval_delete(vproc_t j, struct calendarinterval *ci) { - job_assumes(j, kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); + vproc_assumes(j, kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); SLIST_REMOVE(&j->cal_intervals, ci, calendarinterval, sle); @@ -2023,9 +2023,9 @@ break; } - if (job_assumes(j, ci != NULL)) { + if (vproc_assumes(j, ci != NULL)) { calendarinterval_setalarm(j, ci); - job_dispatch(j, true); + vproc_dispatch(j, true); } } @@ -2034,14 +2034,14 @@ { struct socketgroup *sg = calloc(1, sizeof(struct socketgroup) + strlen(name) + 1); - if (!job_assumes(j, sg != NULL)) + if (!vproc_assumes(j, sg != NULL)) return false; sg->fds = calloc(1, fd_cnt * sizeof(int)); sg->fd_cnt = fd_cnt; sg->junkfds = junkfds; - if (!job_assumes(j, sg->fds != NULL)) { + if (!vproc_assumes(j, sg->fds != NULL)) { free(sg); return false; } @@ -2060,7 +2060,7 @@ unsigned int i; for (i = 0; i < sg->fd_cnt; i++) - job_assumes(j, close(sg->fds[i]) != -1); + vproc_assumes(j, close(sg->fds[i]) != -1); SLIST_REMOVE(&j->sockets, sg, socketgroup, sle); @@ -2080,10 +2080,10 @@ for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); - job_log(j, LOG_DEBUG, "Ignoring Sockets:%s", buf); + vproc_log(j, LOG_DEBUG, "Ignoring Sockets:%s", buf); for (i = 0; i < sg->fd_cnt; i++) - job_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_DELETE, 0, 0, NULL) != -1); + vproc_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_DELETE, 0, 0, NULL) != -1); } void @@ -2098,16 +2098,16 @@ for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); - job_log(j, LOG_DEBUG, "Watching sockets:%s", buf); + vproc_log(j, LOG_DEBUG, "Watching sockets:%s", buf); for (i = 0; i < sg->fd_cnt; i++) - job_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_ADD, 0, 0, j) != -1); + vproc_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_ADD, 0, 0, j) != -1); } void socketgroup_callback(vproc_t j, struct kevent *kev) { - job_dispatch(j, true); + vproc_dispatch(j, true); } bool @@ -2115,7 +2115,7 @@ { struct envitem *ei = calloc(1, sizeof(struct envitem) + strlen(k) + 1 + strlen(v) + 1); - if (!job_assumes(j, ei != NULL)) + if (!vproc_assumes(j, ei != NULL)) return false; strcpy(ei->key, k); @@ -2167,7 +2167,7 @@ if (li == NULL) { li = calloc(1, sizeof(struct limititem)); - if (!job_assumes(j, li != NULL)) + if (!vproc_assumes(j, li != NULL)) return false; li->which = w; @@ -2216,19 +2216,19 @@ } bool -job_useless(vproc_t j) +vproc_useless(vproc_t j) { if (j->unload_at_exit && j->start_time != 0) { - job_log(j, LOG_INFO, "Exited. Was only configured to run once."); + vproc_log(j, LOG_INFO, "Exited. Was only configured to run once."); return true; } else if (shutdown_in_progress) { - job_log(j, LOG_INFO, "Exited while shutdown in progress."); + vproc_log(j, LOG_INFO, "Exited while shutdown in progress."); return true; } else if (!j->checkedin && (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices))) { - job_log(j, LOG_WARNING, "Failed to check-in!"); + vproc_log(j, LOG_WARNING, "Failed to check-in!"); return true; } else if (j->legacy_mach_job && SLIST_EMPTY(&j->machservices)) { - job_log(j, LOG_INFO, "Garbage collecting"); + vproc_log(j, LOG_INFO, "Garbage collecting"); return true; } @@ -2236,7 +2236,7 @@ } bool -job_keepalive(vproc_t j) +vproc_keepalive(vproc_t j) { mach_msg_type_number_t statusCnt; mach_port_status_t status; @@ -2247,12 +2247,12 @@ bool dispatch_others = false; if (j->runatload && j->start_time == 0) { - job_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); + vproc_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); return true; } if (!j->ondemand) { - job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run continuously."); + vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run continuously."); return true; } @@ -2262,7 +2262,7 @@ (mach_port_info_t)&status, &statusCnt) != KERN_SUCCESS) continue; if (status.mps_msgcount) { - job_log(j, LOG_DEBUG, "KeepAlive check: job restarted due to %d queued Mach messages on service: %s", + vproc_log(j, LOG_DEBUG, "KeepAlive check: job restarted due to %d queued Mach messages on service: %s", status.mps_msgcount, ms->name); return true; } @@ -2276,7 +2276,7 @@ wanted_state = true; case NETWORK_DOWN: if (network_up == wanted_state) { - job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the network is %s.", + vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the network is %s.", wanted_state ? "up" : "down"); return true; } @@ -2285,7 +2285,7 @@ wanted_state = true; case FAILED_EXIT: if (good_exit == wanted_state) { - job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the exit state was %s.", + vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the exit state was %s.", wanted_state ? "successful" : "failure"); return true; } @@ -2294,7 +2294,7 @@ wanted_state = true; case PATH_MISSING: if ((bool)(stat(si->what, &sb) == 0) == wanted_state) { - job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the following path %s: %s", + vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the following path %s: %s", wanted_state ? "exists" : "is missing", si->what); return true; } @@ -2305,13 +2305,13 @@ /* Maybe another job has the inverse path based semaphore as this job */ if (dispatch_others) - job_dispatch_all_other_semaphores(root_job, j); + vproc_dispatch_all_other_semaphores(root_job, j); return false; } const char * -job_prog(vproc_t j) +vproc_prog(vproc_t j) { if (j->prog) { return j->prog; @@ -2323,7 +2323,7 @@ } bool -job_active(vproc_t j) +vproc_active(vproc_t j) { struct machservice *ms; @@ -2336,9 +2336,9 @@ if (j->priv_port_has_senders) { if (j->start_time && !j->checkedin) { if (j->legacy_mach_job) { - job_log(j, LOG_NOTICE, "Daemonized. Extremely expensive no-op."); + vproc_log(j, LOG_NOTICE, "Daemonized. Extremely expensive no-op."); } else if (!j->unload_at_exit) { - job_log(j, LOG_ERR, "Daemonization is not supported under launchd."); + vproc_log(j, LOG_ERR, "Daemonization is not supported under launchd."); return false; } } @@ -2356,25 +2356,25 @@ pid_t launchd_fork(void) { - return job_fork(root_job); + return vproc_fork(root_job); } pid_t -job_fork(vproc_t j) +vproc_fork(vproc_t j) { mach_port_t p = j->bs_port; pid_t r = -1; sigprocmask(SIG_BLOCK, &blocked_signals, NULL); - job_assumes(j, launchd_mport_make_send(p) == KERN_SUCCESS); - job_assumes(j, launchd_set_bport(p) == KERN_SUCCESS); - job_assumes(j, launchd_mport_deallocate(p) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_make_send(p) == KERN_SUCCESS); + vproc_assumes(j, launchd_set_bport(p) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_deallocate(p) == KERN_SUCCESS); r = fork(); if (r != 0) { - job_assumes(j, launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); + vproc_assumes(j, launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); } else if (r == 0) { size_t i; @@ -2392,10 +2392,10 @@ void machservice_resetport(vproc_t j, struct machservice *ms) { - job_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); - job_assumes(j, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); - job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS); - job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS); } struct machservice * @@ -2410,10 +2410,10 @@ ms->job = j; if (*serviceport == MACH_PORT_NULL) { - if (!job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) goto out_bad; - if (!job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) goto out_bad2; *serviceport = ms->port; ms->isActive = false; @@ -2425,11 +2425,11 @@ SLIST_INSERT_HEAD(&j->machservices, ms, sle); - job_log(j, LOG_INFO, "Mach service added: %s", name); + vproc_log(j, LOG_INFO, "Mach service added: %s", name); return ms; out_bad2: - job_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + vproc_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); out_bad: free(ms); return NULL; @@ -2470,7 +2470,7 @@ em = EXC_MASK_RPC_ALERT; #endif - if (!job_assumes(ms->job, mhp != MACH_PORT_NULL)) { + if (!vproc_assumes(ms->job, mhp != MACH_PORT_NULL)) { return; } @@ -2485,17 +2485,17 @@ case TASK_BOOTSTRAP_PORT: /* I find it a little odd that zero isn't reserved in the header */ case 0: - job_log(ms->job, LOG_WARNING, "Tried to set a reserved task special port: %d", which_port); + vproc_log(ms->job, LOG_WARNING, "Tried to set a reserved task special port: %d", which_port); break; default: - job_assumes(ms->job, (errno = task_set_special_port(mts, which_port, ms->port)) == KERN_SUCCESS); + vproc_assumes(ms->job, (errno = task_set_special_port(mts, which_port, ms->port)) == KERN_SUCCESS); break; } } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_HOSTSPECIALPORT) == 0 && getpid() == 1) { if (which_port > HOST_MAX_SPECIAL_KERNEL_PORT) { - job_assumes(ms->job, (errno = host_set_special_port(mhp, which_port, ms->port)) == KERN_SUCCESS); + vproc_assumes(ms->job, (errno = host_set_special_port(mhp, which_port, ms->port)) == KERN_SUCCESS); } else { - job_log(ms->job, LOG_WARNING, "Tried to set a reserved host special port: %d", which_port); + vproc_log(ms->job, LOG_WARNING, "Tried to set a reserved host special port: %d", which_port); } } case LAUNCH_DATA_BOOL: @@ -2505,18 +2505,18 @@ } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_HIDEUNTILCHECKIN) == 0) { ms->hide = b; } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_EXCEPTIONSERVER) == 0) { - job_assumes(ms->job, task_set_exception_ports(mts, em, ms->port, + vproc_assumes(ms->job, task_set_exception_ports(mts, em, ms->port, EXCEPTION_STATE_IDENTITY, f) == KERN_SUCCESS); } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_KUNCSERVER) == 0) { ms->kUNCServer = b; - job_assumes(ms->job, host_set_UNDServer(mhp, ms->port) == KERN_SUCCESS); + vproc_assumes(ms->job, host_set_UNDServer(mhp, ms->port) == KERN_SUCCESS); } break; default: break; } - job_assumes(ms->job, launchd_mport_deallocate(mhp) == KERN_SUCCESS); + vproc_assumes(ms->job, launchd_mport_deallocate(mhp) == KERN_SUCCESS); } void @@ -2526,13 +2526,13 @@ struct machservice *ms; mach_port_t p = MACH_PORT_NULL; - if ((ms = job_lookup_service(j->parent, key, false))) { - job_log(j, LOG_WARNING, "Conflict with job: %s over Mach service: %s", ms->job->label, key); + if ((ms = vproc_lookup_service(j->parent, key, false))) { + vproc_log(j, LOG_WARNING, "Conflict with job: %s over Mach service: %s", ms->job->label, key); return; } if ((ms = machservice_new(j, key, &p)) == NULL) { - job_log_error(j, LOG_WARNING, "Cannot add service: %s", key); + vproc_log_error(j, LOG_WARNING, "Cannot add service: %s", key); return; } @@ -2544,34 +2544,34 @@ } vproc_t -job_parent(vproc_t j) +vproc_parent(vproc_t j) { return j->parent; } void -job_uncork_fork(vproc_t j) +vproc_uncork_fork(vproc_t j) { pid_t c = j->p; if (j->stall_before_exec) { - job_log(j, LOG_DEBUG, "Uncorking the fork()."); + vproc_log(j, LOG_DEBUG, "Uncorking the fork()."); /* this unblocks the child and avoids a race * between the above fork() and the kevent_mod() */ write(j->execfd, &c, sizeof(c)); j->stall_before_exec = false; } else { - job_log(j, LOG_WARNING, "Attempt to uncork a job that isn't in the middle of a fork()."); + vproc_log(j, LOG_WARNING, "Attempt to uncork a job that isn't in the middle of a fork()."); } } void -job_foreach_service(vproc_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) +vproc_foreach_service(vproc_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) { struct machservice *ms; vproc_t ji; - j = job_get_bs(j); + j = vproc_get_bs(j); if (include_subjobs) { SLIST_FOREACH(ji, &j->jobs, sle) { @@ -2588,48 +2588,48 @@ } vproc_t -job_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port) +vproc_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port) { char bslabel[1024] = "100000"; vproc_t j; if (requestorport == MACH_PORT_NULL) { if (p) { - job_log(p, LOG_ERR, "Mach sub-bootstrap create request requires a requester port"); + vproc_log(p, LOG_ERR, "Mach sub-bootstrap create request requires a requester port"); } return NULL; } - j = job_new(p, bslabel, NULL, NULL, NULL, requestorport); + j = vproc_new(p, bslabel, NULL, NULL, NULL, requestorport); if (j == NULL) return NULL; if (checkin_port != MACH_PORT_NULL) { j->bs_port = checkin_port; - } else if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) { + } else if (!vproc_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) { goto out_bad; } sprintf(j->label, "%d", MACH_PORT_INDEX(j->bs_port)); - if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + if (!vproc_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) goto out_bad; if (p) { - job_log(p, LOG_DEBUG, "Mach sub-bootstrap created: %s", j->label); + vproc_log(p, LOG_DEBUG, "Mach sub-bootstrap created: %s", j->label); } return j; out_bad: if (j) - job_remove(j); + vproc_remove(j); return NULL; } void -job_delete_anything_with_port(vproc_t j, mach_port_t port) +vproc_delete_anything_with_port(vproc_t j, mach_port_t port) { struct machservice *ms, *next_ms; vproc_t ji, jn; @@ -2645,7 +2645,7 @@ */ SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - job_delete_anything_with_port(ji, port); + vproc_delete_anything_with_port(ji, port); } SLIST_FOREACH_SAFE(ms, &j->machservices, sle, next_ms) { @@ -2657,19 +2657,19 @@ if (j == root_job) { launchd_shutdown(); } else { - job_remove(j); + vproc_remove(j); } } } struct machservice * -job_lookup_service(vproc_t j, const char *name, bool check_parent) +vproc_lookup_service(vproc_t j, const char *name, bool check_parent) { struct machservice *ms; vproc_t ji; - j = job_get_bs(j); + j = vproc_get_bs(j); SLIST_FOREACH(ji, &j->jobs, sle) { if (ji->req_port) @@ -2692,7 +2692,7 @@ if (!check_parent) return NULL; - return job_lookup_service(j->parent, name, true); + return vproc_lookup_service(j->parent, name, true); } mach_port_t @@ -2731,15 +2731,15 @@ if (ms->recv) { if (ms->isActive) { /* FIXME we should cancel the notification */ - job_log(ms->job, LOG_ERR, "Mach service deleted while we didn't own the receive right: %s", ms->name); + vproc_log(ms->job, LOG_ERR, "Mach service deleted while we didn't own the receive right: %s", ms->name); } else { - job_assumes(ms->job, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + vproc_assumes(ms->job, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); } } - job_assumes(ms->job, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); + vproc_assumes(ms->job, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); - job_log(ms->job, LOG_INFO, "Mach service deleted: %s", ms->name); + vproc_log(ms->job, LOG_INFO, "Mach service deleted: %s", ms->name); SLIST_REMOVE(&ms->job->machservices, ms, machservice, sle); @@ -2755,10 +2755,10 @@ if (ms->job->req_port == MACH_PORT_NULL) { which = MACH_NOTIFY_PORT_DESTROYED; - job_checkin(ms->job); + vproc_checkin(ms->job); } - job_assumes(ms->job, launchd_mport_notify_req(ms->port, which) == KERN_SUCCESS); + vproc_assumes(ms->job, launchd_mport_notify_req(ms->port, which) == KERN_SUCCESS); } #define NELEM(x) (sizeof(x)/sizeof(x[0])) @@ -2810,19 +2810,19 @@ } void -job_checkin(vproc_t j) +vproc_checkin(vproc_t j) { j->checkedin = true; } bool -job_ack_port_destruction(vproc_t j, mach_port_t p) +vproc_ack_port_destruction(vproc_t j, mach_port_t p) { vproc_t ji; struct machservice *ms; SLIST_FOREACH(ji, &j->jobs, sle) { - if (job_ack_port_destruction(ji, p)) + if (vproc_ack_port_destruction(ji, p)) return true; } @@ -2839,25 +2839,25 @@ if (ms->reset) machservice_resetport(j, ms); - job_log(j, LOG_DEBUG, "Receive right returned to us: %s", ms->name); + vproc_log(j, LOG_DEBUG, "Receive right returned to us: %s", ms->name); - job_dispatch(j, false); + vproc_dispatch(j, false); return true; } void -job_ack_no_senders(vproc_t j) +vproc_ack_no_senders(vproc_t j) { j->priv_port_has_senders = false; - job_log(j, LOG_DEBUG, "No more senders on privileged Mach bootstrap port"); + vproc_log(j, LOG_DEBUG, "No more senders on privileged Mach bootstrap port"); - job_dispatch(j, false); + vproc_dispatch(j, false); } mach_port_t -job_get_reqport(vproc_t j) +vproc_get_reqport(vproc_t j) { j->transfer_bstrap = true; gc_this_job = j; @@ -2866,25 +2866,25 @@ } mach_port_t -job_get_bsport(vproc_t j) +vproc_get_bsport(vproc_t j) { return j->bs_port; } vproc_t -job_get_bs(vproc_t j) +vproc_get_bs(vproc_t j) { if (j->req_port) return j; - if (job_assumes(j, j->parent != NULL)) + if (vproc_assumes(j, j->parent != NULL)) return j->parent; return NULL; } pid_t -job_get_pid(vproc_t j) +vproc_get_pid(vproc_t j) { return j->p; } @@ -2898,7 +2898,7 @@ if (what) alloc_sz += strlen(what) + 1; - if (!job_assumes(j, si = calloc(1, alloc_sz))) + if (!vproc_assumes(j, si = calloc(1, alloc_sz))) return false; si->why = why; @@ -2950,7 +2950,7 @@ } void -job_dispatch_all_other_semaphores(vproc_t j, vproc_t nj) +vproc_dispatch_all_other_semaphores(vproc_t j, vproc_t nj) { vproc_t ji, jn; @@ -2958,11 +2958,11 @@ return; SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - job_dispatch_all_other_semaphores(ji, nj); + vproc_dispatch_all_other_semaphores(ji, nj); } if (!SLIST_EMPTY(&j->semaphores)) { - job_dispatch(j, false); + vproc_dispatch(j, false); } } Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-06 17:22:43 UTC (rev 22840) @@ -24,8 +24,8 @@ #include "bootstrap_public.h" -#define job_assumes(j, e) \ - (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) +#define vproc_assumes(j, e) \ + (__builtin_expect(!(e), 0) ? vproc_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) typedef struct vproc_s *vproc_t; @@ -43,40 +43,40 @@ bootstrap_status_t machservice_status(struct machservice *); -vproc_t job_find(vproc_t j, const char *label); -vproc_t job_find_by_pid(vproc_t j, pid_t p); -vproc_t job_find_by_port(mach_port_t mp); -vproc_t job_import(launch_data_t pload); -launch_data_t job_import_bulk(launch_data_t pload); -vproc_t job_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); -vproc_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); -vproc_t job_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond); -vproc_t job_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port); -launch_data_t job_export(vproc_t j); -launch_data_t job_export_all(void); -void job_dispatch(vproc_t j, bool kickstart); -void job_dispatch_all_other_semaphores(vproc_t j, vproc_t nj); -void job_stop(vproc_t j); -bool job_active(vproc_t j); -void job_checkin(vproc_t j); -const char *job_prog(vproc_t j); -void job_remove(vproc_t j); -void job_remove_all_inactive(vproc_t j); -bool job_ack_port_destruction(vproc_t j, mach_port_t p); -void job_ack_no_senders(vproc_t j); -pid_t job_get_pid(vproc_t j); -mach_port_t job_get_bsport(vproc_t j); -mach_port_t job_get_reqport(vproc_t j); -vproc_t job_get_bs(vproc_t j); -void job_delete_anything_with_port(vproc_t jbs, mach_port_t port); -vproc_t job_parent(vproc_t j); -void job_uncork_fork(vproc_t j); -struct machservice *job_lookup_service(vproc_t jbs, const char *name, bool check_parent); -void job_foreach_service(vproc_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); -void job_log(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_error(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); -kern_return_t job_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus); +vproc_t vproc_find(vproc_t j, const char *label); +vproc_t vproc_find_by_pid(vproc_t j, pid_t p); +vproc_t vproc_find_by_port(mach_port_t mp); +vproc_t vproc_import(launch_data_t pload); +launch_data_t vproc_import_bulk(launch_data_t pload); +vproc_t vproc_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); +vproc_t vproc_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); +vproc_t vproc_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond); +vproc_t vproc_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port); +launch_data_t vproc_export(vproc_t j); +launch_data_t vproc_export_all(void); +void vproc_dispatch(vproc_t j, bool kickstart); +void vproc_dispatch_all_other_semaphores(vproc_t j, vproc_t nj); +void vproc_stop(vproc_t j); +bool vproc_active(vproc_t j); +void vproc_checkin(vproc_t j); +const char *vproc_prog(vproc_t j); +void vproc_remove(vproc_t j); +void vproc_remove_all_inactive(vproc_t j); +bool vproc_ack_port_destruction(vproc_t j, mach_port_t p); +void vproc_ack_no_senders(vproc_t j); +pid_t vproc_get_pid(vproc_t j); +mach_port_t vproc_get_bsport(vproc_t j); +mach_port_t vproc_get_reqport(vproc_t j); +vproc_t vproc_get_bs(vproc_t j); +void vproc_delete_anything_with_port(vproc_t jbs, mach_port_t port); +vproc_t vproc_parent(vproc_t j); +void vproc_uncork_fork(vproc_t j); +struct machservice *vproc_lookup_service(vproc_t jbs, const char *name, bool check_parent); +void vproc_foreach_service(vproc_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); +void vproc_log(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void vproc_log_error(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void vproc_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); +kern_return_t vproc_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus); extern size_t total_children; Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 17:22:43 UTC (rev 22840) @@ -91,7 +91,7 @@ static bool trusted_client_check(vproc_t j, struct ldcred *ldc); vproc_t -job_find_by_port(mach_port_t mp) +vproc_find_by_port(mach_port_t mp) { return port_to_obj[MACH_PORT_INDEX(mp)]; } @@ -116,7 +116,7 @@ continue; if (status.mps_msgcount) { - EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_find_by_port(members[i])); + EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, vproc_find_by_port(members[i])); (*((kq_callback *)kev.udata))(kev.udata, &kev); /* the callback may have tainted our ability to continue this for loop */ break; @@ -142,7 +142,7 @@ init_ports(); - launchd_assert((root_job = job_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); + launchd_assert((root_job = vproc_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); launchd_assumes(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); @@ -330,19 +330,19 @@ x_bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, audit_token_t au_tok, mach_port_t *server_portp) { - vproc_t js, j = job_find_by_port(bp); + vproc_t js, j = vproc_find_by_port(bp); struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); - job_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); + vproc_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); #define LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 /* XXX - This code should go away once the per session launchd is integrated with the rest of the system */ #ifdef LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 if (getpid() == 1) { if (ldc.euid != 0 && ldc.euid != server_uid) { - job_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", + vproc_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", server_cmd, ldc.euid, server_uid); server_uid = ldc.euid; } @@ -351,17 +351,17 @@ if (!trusted_client_check(j, &ldc)) { return BOOTSTRAP_NOT_PRIVILEGED; } else if (server_uid != getuid()) { - job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", + vproc_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", server_cmd, getuid(), server_uid); server_uid = getuid(); } - js = job_new_via_mach_init(j, server_cmd, server_uid, on_demand); + js = vproc_new_via_mach_init(j, server_cmd, server_uid, on_demand); if (js == NULL) return BOOTSTRAP_NO_MEMORY; - *server_portp = job_get_bsport(js); + *server_portp = vproc_get_bsport(js); return BOOTSTRAP_SUCCESS; } @@ -382,13 +382,13 @@ kern_return_t x_bootstrap_unprivileged(mach_port_t bp, mach_port_t *unprivportp) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); - job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); + vproc_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); - j = job_get_bs(j); + j = vproc_get_bs(j); - *unprivportp = job_get_bsport(j); + *unprivportp = vproc_get_bsport(j); return BOOTSTRAP_SUCCESS; } @@ -398,7 +398,7 @@ x_bootstrap_check_in(mach_port_t bp, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) { static pid_t last_warned_pid = 0; - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -406,15 +406,15 @@ trusted_client_check(j, &ldc); - ms = job_lookup_service(j, servicename, true); + ms = vproc_lookup_service(j, servicename, true); if (ms == NULL) { - job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); + vproc_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); return BOOTSTRAP_UNKNOWN_SERVICE; } if (machservice_job(ms) != j) { if (last_warned_pid != ldc.pid) { - job_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", + vproc_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", ldc.pid, servicename); last_warned_pid = ldc.pid; } @@ -422,13 +422,13 @@ } if (!canReceive(machservice_port(ms))) { launchd_assumes(machservice_active(ms)); - job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Already active: %s", servicename); + vproc_log(j, LOG_DEBUG, "Check-in of Mach service failed. Already active: %s", servicename); return BOOTSTRAP_SERVICE_ACTIVE; } machservice_watch(ms); - job_log(j, LOG_INFO, "Check-in of service: %s", servicename); + vproc_log(j, LOG_INFO, "Check-in of service: %s", servicename); *serviceportp = machservice_port(ms); return BOOTSTRAP_SUCCESS; @@ -437,7 +437,7 @@ kern_return_t x_bootstrap_register(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -445,24 +445,24 @@ trusted_client_check(j, &ldc); - job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); + vproc_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); - ms = job_lookup_service(j, servicename, false); + ms = vproc_lookup_service(j, servicename, false); if (ms) { if (machservice_job(ms) != j) return BOOTSTRAP_NOT_PRIVILEGED; if (machservice_active(ms)) { - job_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); + vproc_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); launchd_assumes(!canReceive(machservice_port(ms))); return BOOTSTRAP_SERVICE_ACTIVE; } - job_checkin(machservice_job(ms)); + vproc_checkin(machservice_job(ms)); machservice_delete(ms); } if (serviceport != MACH_PORT_NULL) { - if ((ms = machservice_new(job_get_bs(j), servicename, &serviceport))) { + if ((ms = machservice_new(vproc_get_bs(j), servicename, &serviceport))) { machservice_watch(ms); } else { return BOOTSTRAP_NO_MEMORY; @@ -475,7 +475,7 @@ kern_return_t x_bootstrap_look_up(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -483,24 +483,24 @@ trusted_client_check(j, &ldc); - ms = job_lookup_service(j, servicename, true); + ms = vproc_lookup_service(j, servicename, true); - if (ms && machservice_hidden(ms) && !job_active(machservice_job(ms))) { + if (ms && machservice_hidden(ms) && !vproc_active(machservice_job(ms))) { ms = NULL; } if (ms) { launchd_assumes(machservice_port(ms) != MACH_PORT_NULL); - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); + vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); *serviceportp = machservice_port(ms); *ptype = MACH_MSG_TYPE_COPY_SEND; return BOOTSTRAP_SUCCESS; } else if (inherited_bootstrap_port != MACH_PORT_NULL) { - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); + vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); *ptype = MACH_MSG_TYPE_MOVE_SEND; return bootstrap_look_up(inherited_bootstrap_port, servicename, serviceportp); } else { - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); + vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); return BOOTSTRAP_UNKNOWN_SERVICE; } } @@ -508,18 +508,18 @@ kern_return_t x_bootstrap_parent(mach_port_t bp, mach_port_t *parentport, mach_msg_type_name_t *pptype) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); - job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); + vproc_log(j, LOG_DEBUG, "Requested parent bootstrap port"); - j = job_get_bs(j); + j = vproc_get_bs(j); *pptype = MACH_MSG_TYPE_MAKE_SEND; - if (job_parent(j)) { - *parentport = job_get_bsport(job_parent(j)); + if (vproc_parent(j)) { + *parentport = vproc_get_bsport(vproc_parent(j)); } else if (MACH_PORT_NULL == inherited_bootstrap_port) { - *parentport = job_get_bsport(j); + *parentport = vproc_get_bsport(j); } else { *pptype = MACH_MSG_TYPE_COPY_SEND; *parentport = inherited_bootstrap_port; @@ -564,12 +564,12 @@ bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - vproc_t ji, j = job_find_by_port(bp); + vproc_t ji, j = vproc_find_by_port(bp); kern_return_t result; unsigned int cnt = 0; - for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, true); + for (ji = j; ji; ji = vproc_parent(ji)) + vproc_foreach_service(ji, x_bootstrap_info_countservices, &cnt, true); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -579,8 +579,8 @@ if (!launchd_assumes(result == KERN_SUCCESS)) goto out_bad; - for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, true); + for (ji = j; ji; ji = vproc_parent(ji)) + vproc_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, true); launchd_assumes(info_resp.i == cnt); @@ -603,21 +603,21 @@ mach_port_array_t *ports, unsigned int *ports_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); unsigned int cnt = 0; kern_return_t result; if (getpid() != 1) { - job_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); + vproc_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); return BOOTSTRAP_NOT_PRIVILEGED; - } else if (!job_parent(j)) { - job_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); + } else if (!vproc_parent(j)) { + vproc_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); return BOOTSTRAP_NOT_PRIVILEGED; } - job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); + vproc_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); - job_foreach_service(j, x_bootstrap_info_countservices, &cnt, false); + vproc_foreach_service(j, x_bootstrap_info_countservices, &cnt, false); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -627,7 +627,7 @@ if (!launchd_assumes(result == KERN_SUCCESS)) goto out_bad; - job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, false); + vproc_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, false); launchd_assumes(info_resp.i == cnt); @@ -635,8 +635,8 @@ *ports = info_resp.ports; *servicenames_cnt = *ports_cnt = cnt; - *reqport = job_get_reqport(j); - *rcvright = job_get_bsport(j); + *reqport = vproc_get_reqport(j); + *rcvright = vproc_get_bsport(j); launchd_assumes(launchd_mport_request_callback(*rcvright, NULL, true) == KERN_SUCCESS); @@ -654,48 +654,48 @@ kern_return_t x_bootstrap_subset(mach_port_t bp, mach_port_t requestorport, mach_port_t *subsetportp) { - vproc_t js, j = job_find_by_port(bp); + vproc_t js, j = vproc_find_by_port(bp); int bsdepth = 0; - while ((j = job_parent(j)) != NULL) + while ((j = vproc_parent(j)) != NULL) bsdepth++; - j = job_find_by_port(bp); + j = vproc_find_by_port(bp); /* Since we use recursion, we need an artificial depth for subsets */ if (bsdepth > 100) { - job_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); + vproc_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); return BOOTSTRAP_NO_MEMORY; } - if ((js = job_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { + if ((js = vproc_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { if (requestorport == MACH_PORT_NULL) return BOOTSTRAP_NOT_PRIVILEGED; return BOOTSTRAP_NO_MEMORY; } - *subsetportp = job_get_bsport(js); + *subsetportp = vproc_get_bsport(js); return BOOTSTRAP_SUCCESS; } kern_return_t x_bootstrap_create_service(mach_port_t bp, name_t servicename, mach_port_t *serviceportp) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); struct machservice *ms; - if (job_prog(j)[0] == '\0') { - job_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); + if (vproc_prog(j)[0] == '\0') { + vproc_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); return BOOTSTRAP_NOT_PRIVILEGED; } - ms = job_lookup_service(j, servicename, false); + ms = vproc_lookup_service(j, servicename, false); if (ms) { - job_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); + vproc_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); return BOOTSTRAP_NAME_IN_USE; } - job_checkin(j); + vproc_checkin(j); *serviceportp = MACH_PORT_NULL; ms = machservice_new(j, servicename, serviceportp); @@ -713,23 +713,23 @@ kern_return_t x_mpm_wait(mach_port_t bp, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); #if 0 struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); #endif - return job_handle_mpm_wait(j, srp, waitstatus); + return vproc_handle_mpm_wait(j, srp, waitstatus); } kern_return_t x_mpm_uncork_fork(mach_port_t bp, audit_token_t au_tok) { - vproc_t j = job_find_by_port(bp); + vproc_t j = vproc_find_by_port(bp); if (!j) return BOOTSTRAP_NOT_PRIVILEGED; - job_uncork_fork(j); + vproc_uncork_fork(j); return 0; } @@ -740,7 +740,7 @@ uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, pid_t *child_pid, mach_port_t *obsvr_port) { - vproc_t jr, j = job_find_by_port(bp); + vproc_t jr, j = vproc_find_by_port(bp); struct ldcred ldc; size_t offset = 0; char *tmpp; @@ -754,7 +754,7 @@ #if 0 if (ldc.asid != inherited_asid) { - job_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", + vproc_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", ldc.pid, ldc.asid, inherited_asid); return BOOTSTRAP_NOT_PRIVILEGED; } @@ -790,7 +790,7 @@ } } - jr = job_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, + jr = vproc_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, flags & SPAWN_WANTS_WAIT4DEBUGGER, flags & SPAWN_WANTS_FORCE_PPC); if (jr == NULL) switch (errno) { @@ -800,12 +800,12 @@ return BOOTSTRAP_NO_MEMORY; } - job_log(j, LOG_INFO, "Spawned with flags:%s%s", + vproc_log(j, LOG_INFO, "Spawned with flags:%s%s", flags & SPAWN_WANTS_FORCE_PPC ? " ppc": "", flags & SPAWN_WANTS_WAIT4DEBUGGER ? " stopped": ""); - *child_pid = job_get_pid(jr); - *obsvr_port = job_get_bsport(jr); + *child_pid = vproc_get_pid(jr); + *obsvr_port = vproc_get_bsport(jr); return BOOTSTRAP_SUCCESS; } @@ -815,7 +815,7 @@ { /* This message is sent to us when a receive right is returned to us. */ - if (!job_ack_port_destruction(root_job, rights)) { + if (!vproc_ack_port_destruction(root_job, rights)) { launchd_assumes(launchd_mport_close_recv(rights) == KERN_SUCCESS); } @@ -837,7 +837,7 @@ kern_return_t do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) { - vproc_t j = job_find_by_port(notify); + vproc_t j = vproc_find_by_port(notify); /* This message is sent to us when the last customer of one of our objects * goes away. @@ -846,7 +846,7 @@ if (!launchd_assumes(j != NULL)) return KERN_FAILURE; - job_ack_no_senders(j); + vproc_ack_no_senders(j); return KERN_SUCCESS; } @@ -874,7 +874,7 @@ inherited_bootstrap_port = MACH_PORT_NULL; } - job_delete_anything_with_port(root_job, name); + vproc_delete_anything_with_port(root_job, name); /* A dead-name notification about a port appears to increment the * rights on said port. Let's deallocate it so that we don't leak @@ -908,7 +908,7 @@ if (last_warned_pid == ldc->pid) return false; - job_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); + vproc_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); last_warned_pid = ldc->pid; Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 17:05:38 UTC (rev 22839) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 17:22:43 UTC (rev 22840) @@ -332,8 +332,8 @@ if (data == NULL) { if (!strcmp(cmd, LAUNCH_KEY_CHECKIN)) { if (rmc->c->j) { - resp = job_export(rmc->c->j); - job_checkin(rmc->c->j); + resp = vproc_export(rmc->c->j); + vproc_checkin(rmc->c->j); } else { resp = launch_data_new_errno(EACCES); } @@ -347,7 +347,7 @@ launchd_single_user(); resp = launch_data_new_errno(0); } else if (!strcmp(cmd, LAUNCH_KEY_GETJOBS)) { - resp = job_export_all(); + resp = vproc_export_all(); ipc_revoke_fds(resp); } else if (!strcmp(cmd, LAUNCH_KEY_GETRESOURCELIMITS)) { resp = adjust_rlimits(NULL); @@ -383,28 +383,28 @@ launch_data_set_bool(resp, batch_disabler_count == 0); } } else if (!strcmp(cmd, LAUNCH_KEY_STARTJOB)) { - if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { - job_dispatch(j, true); + if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { + vproc_dispatch(j, true); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_STOPJOB)) { - if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { - job_stop(j); + if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { + vproc_stop(j); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_REMOVEJOB)) { - if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { - job_remove(j); + if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { + vproc_remove(j); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_SUBMITJOB)) { if (launch_data_get_type(data) == LAUNCH_DATA_ARRAY) { - resp = job_import_bulk(data); + resp = vproc_import_bulk(data); } else { - if (job_import(data)) + if (vproc_import(data)) errno = 0; resp = launch_data_new_errno(errno); } @@ -417,17 +417,17 @@ } else if (!strcmp(cmd, LAUNCH_KEY_SETRESOURCELIMITS)) { resp = adjust_rlimits(data); } else if (!strcmp(cmd, LAUNCH_KEY_GETJOB)) { - if ((j = job_find(root_job, launch_data_get_string(data))) == NULL) { + if ((j = vproc_find(root_job, launch_data_get_string(data))) == NULL) { resp = launch_data_new_errno(errno); } else { - resp = job_export(j); + resp = vproc_export(j); ipc_revoke_fds(resp); } } else if (!strcmp(cmd, LAUNCH_KEY_GETJOBWITHHANDLES)) { - if ((j = job_find(root_job, launch_data_get_string(data))) == NULL) { + if ((j = vproc_find(root_job, launch_data_get_string(data))) == NULL) { resp = launch_data_new_errno(errno); } else { - resp = job_export(j); + resp = vproc_export(j); } } else if (!strcmp(cmd, LAUNCH_KEY_SETLOGMASK)) { resp = launch_data_new_integer(setlogmask(launch_data_get_integer(data))); @@ -438,7 +438,7 @@ } else if (!strcmp(cmd, LAUNCH_KEY_SETSTDERR)) { resp = launchd_setstdio(STDERR_FILENO, data); } else if (!strcmp(cmd, LAUNCH_KEY_BATCHCONTROL)) { - batch_job_enable(launch_data_get_bool(data), rmc->c); + batch_vproc_enable(launch_data_get_bool(data), rmc->c); resp = launch_data_new_errno(0); } @@ -448,7 +448,7 @@ void ipc_close(struct conncb *c) { - batch_job_enable(true, c); + batch_vproc_enable(true, c); SLIST_REMOVE(&connections, c, conncb, sle); launchd_close(c->conn); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/7a18ab9a/attachment.html From source_changes at macosforge.org Wed Sep 6 11:12:50 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:30 2007 Subject: [launchd-changes] [22841] trunk/launchd/src Message-ID: <20060906181250.50D4F21BDF99@cvs.opensource.apple.com> Revision: 22841 Author: zarzycki@apple.com Date: 2006-09-06 11:12:47 -0700 (Wed, 06 Sep 2006) Log Message: ----------- On second thought, launchd sometimes needs to be a consumer of APIs it vends to communicate with a parent launchd. We therefore need to have a different prefix for the internal implementation. External: vproc_t and vprocmgr_t Internal: job_t and jobmgr_t Modified Paths: -------------- trunk/launchd/src/launchctl.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd.h trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c trunk/launchd/src/launchd_unix_ipc.h Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchctl.c 2006-09-06 18:12:47 UTC (rev 22841) @@ -100,7 +100,7 @@ static int _fd(int); static int demux_cmd(int argc, char *const argv[]); static launch_data_t do_rendezvous_magic(const struct addrinfo *res, const char *serv); -static void submit_vproc_pass(launch_data_t jobs); +static void submit_job_pass(launch_data_t jobs); static void submit_mach_jobs(launch_data_t jobs); static void let_go_of_mach_jobs(launch_data_t jobs); static void do_mgroup_join(int fd, int family, int socktype, int protocol, const char *mgroup); @@ -484,7 +484,7 @@ { char ourhostname[1024]; launch_data_t tmpd, tmps, thejob, tmpa; - bool vproc_disabled = false; + bool job_disabled = false; size_t i, c; gethostname(ourhostname, sizeof(ourhostname)); @@ -560,12 +560,12 @@ } if ((tmpd = launch_data_dict_lookup(thejob, LAUNCH_JOBKEY_DISABLED))) - vproc_disabled = launch_data_get_bool(tmpd); + job_disabled = launch_data_get_bool(tmpd); if (lus->forceload) - vproc_disabled = false; + job_disabled = false; - if (vproc_disabled && lus->load) + if (job_disabled && lus->load) goto out_bad; if (delay_to_second_pass(thejob)) @@ -1395,10 +1395,10 @@ if (lus.load) { distill_jobs(lus.pass1); submit_mach_jobs(lus.pass0); - submit_vproc_pass(lus.pass1); + submit_job_pass(lus.pass1); let_go_of_mach_jobs(lus.pass0); distill_jobs(lus.pass2); - submit_vproc_pass(lus.pass2); + submit_job_pass(lus.pass2); } else { for (i = 0; i < launch_data_array_get_count(lus.pass1); i++) unloadjob(launch_data_array_get_index(lus.pass1, i)); @@ -1466,7 +1466,7 @@ } void -submit_vproc_pass(launch_data_t jobs) +submit_job_pass(launch_data_t jobs) { launch_data_t msg, resp; size_t i; Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd.c 2006-09-06 18:12:47 UTC (rev 22841) @@ -121,7 +121,7 @@ static bool re_exec_in_single_user_mode = false; static char *pending_stdout = NULL; static char *pending_stderr = NULL; -static vproc_t rlcj = NULL; +static job_t rlcj = NULL; static jmp_buf doom_doom_doom; sigset_t blocked_signals = 0; @@ -148,7 +148,7 @@ const char *session_type = NULL; const char *optargs = NULL; launch_data_t ldresp, ldmsg = launch_data_new_string(LAUNCH_KEY_CHECKIN); - vproc_t fbj = NULL; + job_t fbj = NULL; struct stat sb; size_t i, checkin_fdcnt = 0; int *checkin_fds = NULL; @@ -282,11 +282,11 @@ if (h) sprintf(ldconf, "%s/%s", h, LAUNCHD_CONF); - rlcj = vproc_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); + rlcj = job_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); launchd_assert(rlcj != NULL); if (argv[0]) - fbj = vproc_new(root_job, FIRSTBORN_LABEL, NULL, (const char *const *)argv, NULL, MACH_PORT_NULL); + fbj = job_new(root_job, FIRSTBORN_LABEL, NULL, (const char *const *)argv, NULL, MACH_PORT_NULL); if (NULL == getenv("PATH")) setenv("PATH", _PATH_STDPATH, 1); @@ -322,10 +322,10 @@ } if (stat(ldconf, &sb) == 0) - vproc_dispatch(rlcj, true); + job_dispatch(rlcj, true); if (fbj) - vproc_dispatch(fbj, true); + job_dispatch(fbj, true); pthread_attr_t attr; pthread_attr_init(&attr); @@ -337,7 +337,7 @@ mach_msg_return_t msgr; mach_msg_size_t mxmsgsz = sizeof(union MaxRequestSize) + MAX_TRAILER_SIZE; - if (getpid() == 1 && !vproc_active(rlcj)) + if (getpid() == 1 && !job_active(rlcj)) init_pre_kevent(); launchd_assert(setjmp(doom_doom_doom) == 0); @@ -401,7 +401,7 @@ } if (getpid() == 1) { - if (rlcj && vproc_active(rlcj)) + if (rlcj && job_active(rlcj)) goto out; init_pre_kevent(); } @@ -493,7 +493,7 @@ rlcj = NULL; - vproc_remove_all_inactive(root_job); + job_remove_all_inactive(root_job); if (getpid() == 1) catatonia(); @@ -528,7 +528,7 @@ switch (kev->ident) { case SIGHUP: if (rlcj) - vproc_dispatch(rlcj, true); + job_dispatch(rlcj, true); break; case SIGTERM: launchd_shutdown(); @@ -626,7 +626,7 @@ } void -batch_vproc_enable(bool e, struct conncb *c) +batch_job_enable(bool e, struct conncb *c) { if (e && c->disabled_batch) { batch_disabler_count--; @@ -701,7 +701,7 @@ if (new_networking_state != network_up) { network_up = new_networking_state; - vproc_dispatch_all_other_semaphores(root_job, NULL); + job_dispatch_all_other_semaphores(root_job, NULL); } } @@ -760,7 +760,7 @@ launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) { if (gc_this_job) { - vproc_remove(gc_this_job); + job_remove(gc_this_job); gc_this_job = NULL; } Modified: trunk/launchd/src/launchd.h =================================================================== --- trunk/launchd/src/launchd.h 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd.h 2006-09-06 18:12:47 UTC (rev 22841) @@ -57,7 +57,7 @@ bool init_check_pid(pid_t); int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); -void batch_vproc_enable(bool e, struct conncb *c); +void batch_job_enable(bool e, struct conncb *c); launch_data_t launchd_setstdio(int d, launch_data_t o); void launchd_SessionCreate(void); Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 18:12:47 UTC (rev 22841) @@ -81,7 +81,7 @@ struct machservice { SLIST_ENTRY(machservice) sle; - vproc_t job; + job_t job; mach_port_name_t port; unsigned int isActive:1, reset:1, recv:1, hide:1, kUNCServer:1, __junk:27; char name[0]; @@ -89,7 +89,7 @@ static void machservice_setup(launch_data_t obj, const char *key, void *context); static void machservice_setup_options(launch_data_t obj, const char *key, void *context); -static void machservice_resetport(vproc_t j, struct machservice *ms); +static void machservice_resetport(job_t j, struct machservice *ms); struct socketgroup { @@ -99,11 +99,11 @@ char name[0]; }; -static bool socketgroup_new(vproc_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds); -static void socketgroup_delete(vproc_t j, struct socketgroup *sg); -static void socketgroup_watch(vproc_t j, struct socketgroup *sg); -static void socketgroup_ignore(vproc_t j, struct socketgroup *sg); -static void socketgroup_callback(vproc_t j, struct kevent *kev); +static bool socketgroup_new(job_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds); +static void socketgroup_delete(job_t j, struct socketgroup *sg); +static void socketgroup_watch(job_t j, struct socketgroup *sg); +static void socketgroup_ignore(job_t j, struct socketgroup *sg); +static void socketgroup_callback(job_t j, struct kevent *kev); static void socketgroup_setup(launch_data_t obj, const char *key, void *context); struct watchpath { @@ -113,22 +113,22 @@ char name[0]; }; -static bool watchpath_new(vproc_t j, const char *name, bool qdir); -static void watchpath_delete(vproc_t j, struct watchpath *wp); -static void watchpath_watch(vproc_t j, struct watchpath *wp); -static void watchpath_ignore(vproc_t j, struct watchpath *wp); -static void watchpath_callback(vproc_t j, struct kevent *kev); +static bool watchpath_new(job_t j, const char *name, bool qdir); +static void watchpath_delete(job_t j, struct watchpath *wp); +static void watchpath_watch(job_t j, struct watchpath *wp); +static void watchpath_ignore(job_t j, struct watchpath *wp); +static void watchpath_callback(job_t j, struct kevent *kev); struct calendarinterval { SLIST_ENTRY(calendarinterval) sle; struct tm when; }; -static bool calendarinterval_new(vproc_t j, struct tm *w); -static bool calendarinterval_new_from_obj(vproc_t j, launch_data_t obj); -static void calendarinterval_delete(vproc_t j, struct calendarinterval *ci); -static void calendarinterval_setalarm(vproc_t j, struct calendarinterval *ci); -static void calendarinterval_callback(vproc_t j, struct kevent *kev); +static bool calendarinterval_new(job_t j, struct tm *w); +static bool calendarinterval_new_from_obj(job_t j, launch_data_t obj); +static void calendarinterval_delete(job_t j, struct calendarinterval *ci); +static void calendarinterval_setalarm(job_t j, struct calendarinterval *ci); +static void calendarinterval_callback(job_t j, struct kevent *kev); struct envitem { SLIST_ENTRY(envitem) sle; @@ -136,8 +136,8 @@ char key[0]; }; -static bool envitem_new(vproc_t j, const char *k, const char *v, bool global); -static void envitem_delete(vproc_t j, struct envitem *ei, bool global); +static bool envitem_new(job_t j, const char *k, const char *v, bool global); +static void envitem_delete(job_t j, struct envitem *ei, bool global); static void envitem_setup(launch_data_t obj, const char *key, void *context); struct limititem { @@ -146,8 +146,8 @@ unsigned int setsoft:1, sethard:1, which:30; }; -static bool limititem_update(vproc_t j, int w, rlim_t r); -static void limititem_delete(vproc_t j, struct limititem *li); +static bool limititem_update(job_t j, int w, rlim_t r); +static void limititem_delete(job_t j, struct limititem *li); static void limititem_setup(launch_data_t obj, const char *key, void *context); typedef enum { @@ -166,15 +166,15 @@ char what[0]; }; -static bool semaphoreitem_new(vproc_t j, semaphore_reason_t why, const char *what); -static void semaphoreitem_delete(vproc_t j, struct semaphoreitem *si); +static bool semaphoreitem_new(job_t j, semaphore_reason_t why, const char *what); +static void semaphoreitem_delete(job_t j, struct semaphoreitem *si); static void semaphoreitem_setup(launch_data_t obj, const char *key, void *context); static void semaphoreitem_setup_paths(launch_data_t obj, const char *key, void *context); -struct vproc_s { - kq_callback kqvproc_callback; - SLIST_ENTRY(vproc_s) sle; +struct job_s { + kq_callback kqjob_callback; + SLIST_ENTRY(job_s) sle; SLIST_HEAD(, socketgroup) sockets; SLIST_HEAD(, watchpath) vnodes; SLIST_HEAD(, calendarinterval) cal_intervals; @@ -183,9 +183,9 @@ SLIST_HEAD(, limititem) limits; SLIST_HEAD(, machservice) machservices; SLIST_HEAD(, semaphoreitem) semaphores; - SLIST_HEAD(, vproc_s) jobs; + SLIST_HEAD(, job_s) jobs; struct rusage ru; - vproc_t parent; + job_t parent; mach_port_t bs_port; mach_port_t req_port; mach_port_t wait_reply_port; @@ -215,29 +215,29 @@ char label[0]; }; -static vproc_t vproc_import2(launch_data_t pload); -static void vproc_import_keys(launch_data_t obj, const char *key, void *context); -static void vproc_import_bool(vproc_t j, const char *key, bool value); -static void vproc_import_string(vproc_t j, const char *key, const char *value); -static void vproc_import_integer(vproc_t j, const char *key, long long value); -static void vproc_import_dictionary(vproc_t j, const char *key, launch_data_t value); -static void vproc_import_array(vproc_t j, const char *key, launch_data_t value); -static void vproc_watch(vproc_t j); -static void vproc_ignore(vproc_t j); -static void vproc_reap(vproc_t j); -static bool vproc_useless(vproc_t j); -static bool vproc_keepalive(vproc_t j); -static void vproc_start(vproc_t j); -static void vproc_start_child(vproc_t j, int execfd) __attribute__((noreturn)); -static void vproc_setup_attributes(vproc_t j); -static bool vproc_setup_machport(vproc_t j); -static void vproc_postfork_become_user(vproc_t j); -static void vproc_callback(void *obj, struct kevent *kev); -static pid_t vproc_fork(vproc_t j); -static size_t vproc_prep_log_preface(vproc_t j, char *buf); -static void vproc_setup_env_from_other_jobs(vproc_t j); -static void vproc_export_all2(vproc_t j, launch_data_t where); -static launch_data_t vproc_export2(vproc_t j, bool subjobs); +static job_t job_import2(launch_data_t pload); +static void job_import_keys(launch_data_t obj, const char *key, void *context); +static void job_import_bool(job_t j, const char *key, bool value); +static void job_import_string(job_t j, const char *key, const char *value); +static void job_import_integer(job_t j, const char *key, long long value); +static void job_import_dictionary(job_t j, const char *key, launch_data_t value); +static void job_import_array(job_t j, const char *key, launch_data_t value); +static void job_watch(job_t j); +static void job_ignore(job_t j); +static void job_reap(job_t j); +static bool job_useless(job_t j); +static bool job_keepalive(job_t j); +static void job_start(job_t j); +static void job_start_child(job_t j, int execfd) __attribute__((noreturn)); +static void job_setup_attributes(job_t j); +static bool job_setup_machport(job_t j); +static void job_postfork_become_user(job_t j); +static void job_callback(void *obj, struct kevent *kev); +static pid_t job_fork(job_t j); +static size_t job_prep_log_preface(job_t j, char *buf); +static void job_setup_env_from_other_jobs(job_t j); +static void job_export_all2(job_t j, launch_data_t where); +static launch_data_t job_export2(job_t j, bool subjobs); static const struct { @@ -266,10 +266,10 @@ kq_callback kqsimple_zombie_reaper = simple_zombie_reaper; -static int dir_has_files(vproc_t j, const char *path); +static int dir_has_files(job_t j, const char *path); static char **mach_cmd2argv(const char *string); -vproc_t root_job = NULL; -vproc_t gc_this_job = NULL; +job_t root_job = NULL; +job_t gc_this_job = NULL; size_t total_children = 0; void @@ -279,7 +279,7 @@ } void -vproc_ignore(vproc_t j) +job_ignore(job_t j) { struct socketgroup *sg; struct machservice *ms; @@ -292,11 +292,11 @@ watchpath_ignore(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - vproc_assumes(j, launchd_mport_request_callback(ms->port, NULL, false) == KERN_SUCCESS); + job_assumes(j, launchd_mport_request_callback(ms->port, NULL, false) == KERN_SUCCESS); } void -vproc_watch(vproc_t j) +job_watch(job_t j) { struct socketgroup *sg; struct machservice *ms; @@ -309,24 +309,24 @@ watchpath_watch(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - vproc_assumes(j, launchd_mport_request_callback(ms->port, j, false) == KERN_SUCCESS); + job_assumes(j, launchd_mport_request_callback(ms->port, j, false) == KERN_SUCCESS); } void -vproc_stop(vproc_t j) +job_stop(job_t j) { if (j->p) kill(j->p, SIGTERM); } launch_data_t -vproc_export(vproc_t j) +job_export(job_t j) { - return vproc_export2(j, true); + return job_export2(j, true); } launch_data_t -vproc_export2(vproc_t j, bool subjobs) +job_export2(job_t j, bool subjobs) { launch_data_t tmp, tmp2, tmp3, r = launch_data_alloc(LAUNCH_DATA_DICTIONARY); @@ -403,11 +403,11 @@ } if (subjobs && !SLIST_EMPTY(&j->jobs) && (tmp = launch_data_alloc(LAUNCH_DATA_ARRAY))) { - vproc_t ji; + job_t ji; size_t i = 0; SLIST_FOREACH(ji, &j->jobs, sle) { - tmp2 = vproc_export2(ji, true); + tmp2 = job_export2(ji, true); launch_data_array_set_index(tmp, tmp2, i); i++; } @@ -419,25 +419,25 @@ } void -vproc_remove_all_inactive(vproc_t j) +job_remove_all_inactive(job_t j) { - vproc_t ji, jn; + job_t ji, jn; SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - vproc_remove_all_inactive(ji); + job_remove_all_inactive(ji); } - if (!vproc_active(j)) { - vproc_remove(j); + if (!job_active(j)) { + job_remove(j); } else if (getpid() != 1) { - vproc_stop(j); + job_stop(j); } } void -vproc_remove(vproc_t j) +job_remove(job_t j) { - vproc_t ji; + job_t ji; struct calendarinterval *ci; struct socketgroup *sg; struct watchpath *wp; @@ -446,34 +446,34 @@ struct machservice *ms; struct semaphoreitem *si; - vproc_log(j, LOG_DEBUG, "Removed"); + job_log(j, LOG_DEBUG, "Removed"); if (j->p) { if (kevent_mod(j->p, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &kqsimple_zombie_reaper) == -1) { - vproc_reap(j); + job_reap(j); } else { /* we've attached the simple zombie reaper, we're going to delete the job before it is dead */ total_children--; - vproc_stop(j); + job_stop(j); } } if (j->parent) - SLIST_REMOVE(&j->parent->jobs, j, vproc_s, sle); + SLIST_REMOVE(&j->parent->jobs, j, job_s, sle); if (j->execfd) - vproc_assumes(j, close(j->execfd) == 0); + job_assumes(j, close(j->execfd) == 0); if (j->bs_port) { if (j->transfer_bstrap) { - vproc_assumes(j, launchd_mport_deallocate(j->bs_port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_deallocate(j->bs_port) == KERN_SUCCESS); } else { - vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); } } if (j->req_port) - vproc_assumes(j, launchd_mport_deallocate(j->req_port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_deallocate(j->req_port) == KERN_SUCCESS); #if 0 if (j->wait_reply_port) { @@ -481,7 +481,7 @@ #endif while ((ji = SLIST_FIRST(&j->jobs))) - vproc_remove(ji); + job_remove(ji); while ((sg = SLIST_FIRST(&j->sockets))) socketgroup_delete(j, sg); @@ -545,7 +545,7 @@ socketgroup_setup(launch_data_t obj, const char *key, void *context) { launch_data_t tmp_oai; - vproc_t j = context; + job_t j = context; unsigned int i, fd_cnt = 1; int *fds; @@ -569,39 +569,39 @@ } bool -vproc_setup_machport(vproc_t j) +job_setup_machport(job_t j) { - if (!vproc_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) goto out_bad; - if (!vproc_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) goto out_bad2; return true; out_bad2: - vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); out_bad: return false; } -vproc_t -vproc_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond) +job_t +job_new_via_mach_init(job_t jbs, const char *cmd, uid_t uid, bool ond) { const char **argv = (const char **)mach_cmd2argv(cmd); - vproc_t j = NULL; + job_t j = NULL; char buf[1000]; - if (!vproc_assumes(jbs, argv != NULL)) + if (!job_assumes(jbs, argv != NULL)) goto out_bad; /* preflight the string so we know how big it is */ sprintf(buf, "100000.%s", basename((char *)argv[0])); - j = vproc_new(jbs, buf, NULL, argv, NULL, MACH_PORT_NULL); + j = job_new(jbs, buf, NULL, argv, NULL, MACH_PORT_NULL); free(argv); - if (!vproc_assumes(jbs, j != NULL)) + if (!job_assumes(jbs, j != NULL)) goto out_bad; j->mach_uid = uid; @@ -609,28 +609,28 @@ j->legacy_mach_job = true; j->priv_port_has_senders = true; /* the IPC that called us will make-send on this port */ - if (!vproc_setup_machport(j)) + if (!job_setup_machport(j)) goto out_bad; - if (!vproc_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS)) { - vproc_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); + if (!job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS)) { + job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); goto out_bad; } sprintf(j->label, "%d.%s", MACH_PORT_INDEX(j->bs_port), basename(j->argv[0])); - vproc_log(j, LOG_INFO, "New%s server in bootstrap: %x", ond ? " on-demand" : "", jbs->bs_port); + job_log(j, LOG_INFO, "New%s server in bootstrap: %x", ond ? " on-demand" : "", jbs->bs_port); return j; out_bad: if (j) - vproc_remove(j); + job_remove(j); return NULL; } kern_return_t -vproc_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus) +job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus) { if (j->p) { j->wait_reply_port = srp; @@ -642,17 +642,17 @@ return 0; } -vproc_t -vproc_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc) +job_t +job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc) { - vproc_t jr; + job_t jr; - if ((jr = vproc_find(root_job, label)) != NULL) { + if ((jr = job_find(root_job, label)) != NULL) { errno = EEXIST; return NULL; } - jr = vproc_new(root_job, label, path, argv, NULL, MACH_PORT_NULL); + jr = job_new(root_job, label, path, argv, NULL, MACH_PORT_NULL); if (!jr) return NULL; @@ -661,8 +661,8 @@ jr->stall_before_exec = w4d; jr->force_ppc = fppc; - if (!vproc_setup_machport(jr)) { - vproc_remove(jr); + if (!job_setup_machport(jr)) { + job_remove(jr); return NULL; } @@ -677,7 +677,7 @@ if (env) for (; *env; env++) { char newkey[strlen(*env) + 1], *eqoff = strchr(*env, '='); if (!eqoff) { - vproc_log(jr, LOG_WARNING, "Environmental variable missing '=' separator: %s", *env); + job_log(jr, LOG_WARNING, "Environmental variable missing '=' separator: %s", *env); continue; } strcpy(newkey, *env); @@ -685,51 +685,51 @@ envitem_new(jr, newkey, eqoff + 1, false); } - vproc_dispatch(jr, true); + job_dispatch(jr, true); return jr; } -vproc_t -vproc_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) +job_t +job_new(job_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) { const char *const *argv_tmp = argv; char *co; int i, cc = 0; - vproc_t j; + job_t j; if (reqport == MACH_PORT_NULL && prog == NULL && argv == NULL) { errno = EINVAL; return NULL; } - j = calloc(1, sizeof(struct vproc_s) + strlen(label) + 1); + j = calloc(1, sizeof(struct job_s) + strlen(label) + 1); - if (!vproc_assumes(p, j != NULL)) + if (!job_assumes(p, j != NULL)) goto out_bad; strcpy(j->label, label); - j->kqvproc_callback = vproc_callback; - j->parent = p ? vproc_get_bs(p) : NULL; + j->kqjob_callback = job_callback; + j->parent = p ? job_get_bs(p) : NULL; j->ondemand = true; j->checkedin = true; j->firstborn = (strcmp(label, FIRSTBORN_LABEL) == 0); if (reqport != MACH_PORT_NULL) { j->req_port = reqport; - if (!vproc_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) goto out_bad; } if (prog) { j->prog = strdup(prog); - if (!vproc_assumes(j, j->prog != NULL)) + if (!job_assumes(j, j->prog != NULL)) goto out_bad; } if (stdinpath) { j->stdinpath = strdup(stdinpath); - if (!vproc_assumes(j, j->stdinpath != NULL)) + if (!job_assumes(j, j->stdinpath != NULL)) goto out_bad; } @@ -742,7 +742,7 @@ j->argv = malloc((j->argc + 1) * sizeof(char *) + cc); - if (!vproc_assumes(j, j->argv != NULL)) + if (!job_assumes(j, j->argv != NULL)) goto out_bad; co = ((char *)j->argv) + ((j->argc + 1) * sizeof(char *)); @@ -757,7 +757,7 @@ if (j->parent) { SLIST_INSERT_HEAD(&j->parent->jobs, j, sle); - vproc_log(j->parent, LOG_DEBUG, "Conceived"); + job_log(j->parent, LOG_DEBUG, "Conceived"); } return j; @@ -773,30 +773,30 @@ return NULL; } -vproc_t -vproc_import(launch_data_t pload) +job_t +job_import(launch_data_t pload) { - vproc_t j = vproc_import2(pload); + job_t j = job_import2(pload); if (j == NULL) return NULL; - vproc_dispatch(j, false); + job_dispatch(j, false); return j; } launch_data_t -vproc_import_bulk(launch_data_t pload) +job_import_bulk(launch_data_t pload) { launch_data_t resp = launch_data_alloc(LAUNCH_DATA_ARRAY); - vproc_t *ja; + job_t *ja; size_t i, c = launch_data_array_get_count(pload); - ja = alloca(c * sizeof(vproc_t )); + ja = alloca(c * sizeof(job_t )); for (i = 0; i < c; i++) { - if ((ja[i] = vproc_import2(launch_data_array_get_index(pload, i)))) + if ((ja[i] = job_import2(launch_data_array_get_index(pload, i)))) errno = 0; launch_data_array_set_index(resp, launch_data_new_errno(errno), i); } @@ -804,14 +804,14 @@ for (i = 0; i < c; i++) { if (ja[i] == NULL) continue; - vproc_dispatch(ja[i], false); + job_dispatch(ja[i], false); } return resp; } void -vproc_import_bool(vproc_t j, const char *key, bool value) +job_import_bool(job_t j, const char *key, bool value) { switch (key[0]) { case 'f': @@ -848,7 +848,7 @@ case 'I': if (strcasecmp(key, LAUNCH_JOBKEY_INITGROUPS) == 0) { if (getuid() == 0) { - vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); + job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } j->no_init_groups = !value; @@ -875,7 +875,7 @@ } void -vproc_import_string(vproc_t j, const char *key, const char *value) +job_import_string(job_t j, const char *key, const char *value) { char **where2put = NULL; @@ -894,7 +894,7 @@ case 'R': if (strcasecmp(key, LAUNCH_JOBKEY_ROOTDIRECTORY) == 0) { if (getuid() != 0) { - vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); + job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->rootdir; @@ -909,7 +909,7 @@ case 'U': if (strcasecmp(key, LAUNCH_JOBKEY_USERNAME) == 0) { if (getuid() != 0 || strcmp(value, "root") == 0) { - vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); + job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->username; @@ -919,7 +919,7 @@ case 'G': if (strcasecmp(key, LAUNCH_JOBKEY_GROUPNAME) == 0) { if (getuid() != 0 || strcmp(value, "wheel") == 0) { - vproc_log(j, LOG_WARNING, "Ignored this key: %s", key); + job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } where2put = &j->groupname; @@ -938,14 +938,14 @@ } if (where2put) { - vproc_assumes(j, (*where2put = strdup(value)) != NULL); + job_assumes(j, (*where2put = strdup(value)) != NULL); } else { - vproc_log(j, LOG_WARNING, "Unknown key: %s", key); + job_log(j, LOG_WARNING, "Unknown key: %s", key); } } void -vproc_import_integer(vproc_t j, const char *key, long long value) +job_import_integer(job_t j, const char *key, long long value) { switch (key[0]) { case 'n': @@ -957,7 +957,7 @@ case 'T': if (strcasecmp(key, LAUNCH_JOBKEY_TIMEOUT) == 0) { if (value <= 0) - vproc_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); + job_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); else j->timeout = value; } @@ -973,11 +973,11 @@ case 'S': if (strcasecmp(key, LAUNCH_JOBKEY_STARTINTERVAL) == 0) { if (value <= 0) - vproc_log(j, LOG_WARNING, "StartInterval is not greater than zero, ignoring"); + job_log(j, LOG_WARNING, "StartInterval is not greater than zero, ignoring"); else j->start_interval = value; if (-1 == kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, value, j)) - vproc_log_error(j, LOG_ERR, "adding kevent timer"); + job_log_error(j, LOG_ERR, "adding kevent timer"); } break; default: @@ -986,7 +986,7 @@ } void -vproc_import_dictionary(vproc_t j, const char *key, launch_data_t value) +job_import_dictionary(job_t j, const char *key, launch_data_t value) { launch_data_t tmp; @@ -1040,7 +1040,7 @@ if (strcasecmp(key, LAUNCH_JOBKEY_MACHSERVICES) == 0) { launch_data_dict_iterate(value, machservice_setup, j); if (!SLIST_EMPTY(&j->machservices)) - vproc_setup_machport(j); + job_setup_machport(j); } break; default: @@ -1049,7 +1049,7 @@ } void -vproc_import_array(vproc_t j, const char *key, launch_data_t value) +job_import_array(job_t j, const char *key, launch_data_t value) { bool is_q_dir = false; bool is_wp = false; @@ -1095,9 +1095,9 @@ } void -vproc_import_keys(launch_data_t obj, const char *key, void *context) +job_import_keys(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; launch_data_type_t kind; if (obj == NULL) @@ -1107,33 +1107,33 @@ switch (kind) { case LAUNCH_DATA_BOOL: - vproc_import_bool(j, key, launch_data_get_bool(obj)); + job_import_bool(j, key, launch_data_get_bool(obj)); break; case LAUNCH_DATA_STRING: - vproc_import_string(j, key, launch_data_get_string(obj)); + job_import_string(j, key, launch_data_get_string(obj)); break; case LAUNCH_DATA_INTEGER: - vproc_import_integer(j, key, launch_data_get_integer(obj)); + job_import_integer(j, key, launch_data_get_integer(obj)); break; case LAUNCH_DATA_DICTIONARY: - vproc_import_dictionary(j, key, obj); + job_import_dictionary(j, key, obj); break; case LAUNCH_DATA_ARRAY: - vproc_import_array(j, key, obj); + job_import_array(j, key, obj); break; default: - vproc_log(j, LOG_WARNING, "Unknown value type '%d' for key: %s", kind, key); + job_log(j, LOG_WARNING, "Unknown value type '%d' for key: %s", kind, key); break; } } -vproc_t -vproc_import2(launch_data_t pload) +job_t +job_import2(launch_data_t pload) { launch_data_t tmp, ldpa; const char *label = NULL, *prog = NULL; const char **argv = NULL; - vproc_t j; + job_t j; if (pload == NULL) return NULL; @@ -1154,7 +1154,7 @@ if (label == NULL) { errno = EINVAL; return NULL; - } else if ((j = vproc_find(root_job, label)) != NULL) { + } else if ((j = job_find(root_job, label)) != NULL) { errno = EEXIST; return NULL; } else if (label[0] == '\0' || (strncasecmp(label, "", strlen("com.apple.launchd")) == 0) || @@ -1175,16 +1175,16 @@ argv[i] = NULL; } - if ((j = vproc_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) - launch_data_dict_iterate(pload, vproc_import_keys, j); + if ((j = job_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) + launch_data_dict_iterate(pload, job_import_keys, j); return j; } -vproc_t -vproc_find(vproc_t j, const char *label) +job_t +job_find(job_t j, const char *label) { - vproc_t jr, ji; + job_t jr, ji; if (label[0] == '\0') return root_job; @@ -1193,7 +1193,7 @@ return j; SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = vproc_find(ji, label))) + if ((jr = job_find(ji, label))) return jr; } @@ -1201,16 +1201,16 @@ return NULL; } -vproc_t -vproc_find_by_pid(vproc_t j, pid_t p) +job_t +job_find_by_pid(job_t j, pid_t p) { - vproc_t jr, ji; + job_t jr, ji; if (j->p == p) return j; SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = vproc_find_by_pid(ji, p))) + if ((jr = job_find_by_pid(ji, p))) return jr; } @@ -1219,48 +1219,48 @@ } void -vproc_export_all2(vproc_t j, launch_data_t where) +job_export_all2(job_t j, launch_data_t where) { launch_data_t tmp; - vproc_t ji; + job_t ji; - if (vproc_assumes(j, (tmp = vproc_export2(j, false)) != NULL)) + if (job_assumes(j, (tmp = job_export2(j, false)) != NULL)) launch_data_dict_insert(where, tmp, j->label); SLIST_FOREACH(ji, &j->jobs, sle) - vproc_export_all2(ji, where); + job_export_all2(ji, where); } launch_data_t -vproc_export_all(void) +job_export_all(void) { launch_data_t resp = launch_data_alloc(LAUNCH_DATA_DICTIONARY); - vproc_export_all2(root_job, resp); + job_export_all2(root_job, resp); return resp; } void -vproc_reap(vproc_t j) +job_reap(job_t j) { struct rusage ru; int status; - vproc_log(j, LOG_DEBUG, "Reaping"); + job_log(j, LOG_DEBUG, "Reaping"); if (j->execfd) { - vproc_assumes(j, close(j->execfd) == 0); + job_assumes(j, close(j->execfd) == 0); j->execfd = 0; } - if (!vproc_assumes(j, wait4(j->p, &status, 0, &ru) != -1)) { + if (!job_assumes(j, wait4(j->p, &status, 0, &ru) != -1)) { return; } if (j->wait_reply_port) { - vproc_log(j, LOG_DEBUG, "MPM wait reply being sent"); - vproc_assumes(j, mpm_wait_reply(j->wait_reply_port, 0, status) == 0); + job_log(j, LOG_DEBUG, "MPM wait reply being sent"); + job_assumes(j, mpm_wait_reply(j->wait_reply_port, 0, status) == 0); j->wait_reply_port = MACH_PORT_NULL; } @@ -1282,15 +1282,15 @@ j->ru.ru_nivcsw += ru.ru_nivcsw; if (WIFEXITED(status) && WEXITSTATUS(status) != 0) { - vproc_log(j, LOG_WARNING, "exited with exit code: %d", WEXITSTATUS(status)); + job_log(j, LOG_WARNING, "exited with exit code: %d", WEXITSTATUS(status)); } if (WIFSIGNALED(status)) { int s = WTERMSIG(status); if (SIGKILL == s || SIGTERM == s) { - vproc_log(j, LOG_NOTICE, "Exited: %s", strsignal(s)); + job_log(j, LOG_NOTICE, "Exited: %s", strsignal(s)); } else { - vproc_log(j, LOG_WARNING, "Exited abnormally: %s", strsignal(s)); + job_log(j, LOG_WARNING, "Exited abnormally: %s", strsignal(s)); } } @@ -1300,7 +1300,7 @@ } void -vproc_dispatch(vproc_t j, bool kickstart) +job_dispatch(job_t j, bool kickstart) { /* * The whole job removal logic needs to be consolidated. The fact that @@ -1310,21 +1310,21 @@ * * This is a classic example. The act of dispatching a job may delete it. */ - if (vproc_active(j)) { + if (job_active(j)) { return; - } else if (vproc_useless(j)) { - vproc_remove(j); - } else if (kickstart || vproc_keepalive(j)) { - vproc_start(j); + } else if (job_useless(j)) { + job_remove(j); + } else if (kickstart || job_keepalive(j)) { + job_start(j); } else { - vproc_watch(j); + job_watch(j); } } void -vproc_callback(void *obj, struct kevent *kev) +job_callback(void *obj, struct kevent *kev) { - vproc_t j = obj; + job_t j = obj; bool d = j->debug; int oldmask = 0; @@ -1334,18 +1334,18 @@ switch (kev->filter) { case EVFILT_PROC: - vproc_reap(j); + job_reap(j); if (j->firstborn) { - vproc_log(j, LOG_DEBUG, "first born died, begin shutdown"); + job_log(j, LOG_DEBUG, "first born died, begin shutdown"); launchd_shutdown(); } else { - vproc_dispatch(j, false); + job_dispatch(j, false); } break; case EVFILT_TIMER: if ((uintptr_t)j == kev->ident || (uintptr_t)&j->start_interval == kev->ident) { - vproc_dispatch(j, true); + job_dispatch(j, true); } else { calendarinterval_callback(j, kev); } @@ -1360,38 +1360,38 @@ } if (j->wait4debugger) { /* Allow somebody else to attach */ - vproc_assumes(j, kill(j->p, SIGSTOP) != -1); - vproc_assumes(j, ptrace(PT_DETACH, j->p, NULL, 0) != -1); + job_assumes(j, kill(j->p, SIGSTOP) != -1); + job_assumes(j, ptrace(PT_DETACH, j->p, NULL, 0) != -1); } if (kev->data > 0) { int e; read(j->execfd, &e, sizeof(e)); errno = e; - vproc_log_error(j, LOG_ERR, "execve()"); - vproc_remove(j); + job_log_error(j, LOG_ERR, "execve()"); + job_remove(j); j = NULL; } else { - vproc_assumes(j, close(j->execfd) == 0); + job_assumes(j, close(j->execfd) == 0); j->execfd = 0; } break; case EVFILT_MACHPORT: - vproc_dispatch(j, true); + job_dispatch(j, true); break; default: - vproc_assumes(j, false); + job_assumes(j, false); break; } if (d) { - /* the job might have been removed, must not call vproc_log() */ + /* the job might have been removed, must not call job_log() */ setlogmask(oldmask); } } void -vproc_start(vproc_t j) +job_start(job_t j) { int spair[2]; int execspair[2]; @@ -1400,14 +1400,14 @@ bool sipc = false; time_t td; - if (!vproc_assumes(j, j->req_port == MACH_PORT_NULL)) + if (!job_assumes(j, j->req_port == MACH_PORT_NULL)) return; - if (!vproc_assumes(j, j->parent != NULL)) + if (!job_assumes(j, j->parent != NULL)) return; - if (vproc_active(j)) { - vproc_log(j, LOG_DEBUG, "Already started"); + if (job_active(j)) { + job_log(j, LOG_DEBUG, "Already started"); return; } @@ -1416,12 +1416,12 @@ if (td < LAUNCHD_MIN_JOB_RUN_TIME) { time_t respawn_delta = LAUNCHD_MIN_JOB_RUN_TIME - td; - vproc_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); - vproc_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); + job_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); + job_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); return; } - vproc_log(j, LOG_DEBUG, "Starting"); + job_log(j, LOG_DEBUG, "Starting"); if (!j->legacy_mach_job) sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); @@ -1440,57 +1440,57 @@ time(&j->start_time); if (j->bs_port) { - vproc_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS); + job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS); } - switch (c = vproc_fork(j->bs_port ? j : j->parent)) { + switch (c = job_fork(j->bs_port ? j : j->parent)) { case -1: - vproc_log_error(j, LOG_ERR, "fork() failed, will try again in one second"); - vproc_assumes(j, close(execspair[0]) == 0); - vproc_assumes(j, close(execspair[1]) == 0); + job_log_error(j, LOG_ERR, "fork() failed, will try again in one second"); + job_assumes(j, close(execspair[0]) == 0); + job_assumes(j, close(execspair[1]) == 0); if (sipc) { - vproc_assumes(j, close(spair[0]) == 0); - vproc_assumes(j, close(spair[1]) == 0); + job_assumes(j, close(spair[0]) == 0); + job_assumes(j, close(spair[1]) == 0); } break; case 0: - vproc_assumes(j, close(execspair[0]) == 0); + job_assumes(j, close(execspair[0]) == 0); /* wait for our parent to say they've attached a kevent to us */ read(_fd(execspair[1]), &c, sizeof(c)); if (j->firstborn) { setpgid(getpid(), getpid()); if (isatty(STDIN_FILENO)) { if (tcsetpgrp(STDIN_FILENO, getpid()) == -1) - vproc_log_error(j, LOG_WARNING, "tcsetpgrp()"); + job_log_error(j, LOG_WARNING, "tcsetpgrp()"); } } if (sipc) { - vproc_assumes(j, close(spair[0]) == 0); + job_assumes(j, close(spair[0]) == 0); sprintf(nbuf, "%d", spair[1]); setenv(LAUNCHD_TRUSTED_FD_ENV, nbuf, 1); } - vproc_start_child(j, execspair[1]); + job_start_child(j, execspair[1]); break; default: if (!SLIST_EMPTY(&j->machservices)) j->priv_port_has_senders = true; j->p = c; total_children++; - vproc_assumes(j, close(execspair[1]) == 0); + job_assumes(j, close(execspair[1]) == 0); j->execfd = _fd(execspair[0]); if (sipc) { - vproc_assumes(j, close(spair[1]) == 0); + job_assumes(j, close(spair[1]) == 0); ipc_open(_fd(spair[0]), j); } - if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqvproc_callback) == -1) - vproc_log_error(j, LOG_ERR, "kevent_mod(j->execfd): %m"); - if (kevent_mod(c, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &j->kqvproc_callback) == -1) { - vproc_log_error(j, LOG_ERR, "kevent()"); - vproc_reap(j); + if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqjob_callback) == -1) + job_log_error(j, LOG_ERR, "kevent_mod(j->execfd): %m"); + if (kevent_mod(c, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &j->kqjob_callback) == -1) { + job_log_error(j, LOG_ERR, "kevent()"); + job_reap(j); } else { if (j->ondemand) - vproc_ignore(j); + job_ignore(j); } if (!j->stall_before_exec) { @@ -1503,7 +1503,7 @@ } void -vproc_start_child(vproc_t j, int execfd) +job_start_child(job_t j, int execfd) { const char *file2exec = "/usr/libexec/launchproxy"; const char **argv; @@ -1511,7 +1511,7 @@ glob_t g; int i; - vproc_setup_attributes(j); + job_setup_attributes(j); if (j->argv && j->globargv) { g.gl_offs = 1; @@ -1519,7 +1519,7 @@ if (i > 0) gflags |= GLOB_APPEND; if (glob(j->argv[i], gflags, NULL, &g) != 0) { - vproc_log_error(j, LOG_ERR, "glob(\"%s\")", j->argv[i]); + job_log_error(j, LOG_ERR, "glob(\"%s\")", j->argv[i]); exit(EXIT_FAILURE); } } @@ -1542,42 +1542,42 @@ argv++; if (j->wait4debugger && ptrace(PT_TRACE_ME, getpid(), NULL, 0) == -1) - vproc_log_error(j, LOG_ERR, "ptrace(PT_TRACE_ME, ...)"); + job_log_error(j, LOG_ERR, "ptrace(PT_TRACE_ME, ...)"); if (j->force_ppc) { int affinmib[] = { CTL_KERN, KERN_AFFINITY, 1, 1 }; size_t mibsz = sizeof(affinmib) / sizeof(affinmib[0]); if (sysctl(affinmib, mibsz, NULL, NULL, NULL, 0) == -1) - vproc_log_error(j, LOG_WARNING, "Failed to force PowerPC execution"); + job_log_error(j, LOG_WARNING, "Failed to force PowerPC execution"); } if (j->prog) { execv(j->inetcompat ? file2exec : j->prog, (char *const*)argv); - vproc_log_error(j, LOG_ERR, "execv(\"%s\", ...)", j->prog); + job_log_error(j, LOG_ERR, "execv(\"%s\", ...)", j->prog); } else { execvp(j->inetcompat ? file2exec : argv[0], (char *const*)argv); - vproc_log_error(j, LOG_ERR, "execvp(\"%s\", ...)", argv[0]); + job_log_error(j, LOG_ERR, "execvp(\"%s\", ...)", argv[0]); } write(execfd, &errno, sizeof(errno)); exit(EXIT_FAILURE); } -void vproc_setup_env_from_other_jobs(vproc_t j) +void job_setup_env_from_other_jobs(job_t j) { struct envitem *ei; - vproc_t ji; + job_t ji; SLIST_FOREACH(ji, &j->jobs, sle) - vproc_setup_env_from_other_jobs(ji); + job_setup_env_from_other_jobs(ji); SLIST_FOREACH(ei, &j->global_env, sle) setenv(ei->key, ei->value, 1); } void -vproc_postfork_become_user(vproc_t j) +job_postfork_become_user(job_t j) { char loginname[2000]; struct passwd *pwe; @@ -1589,12 +1589,12 @@ if (j->username) { if ((pwe = getpwnam(j->username)) == NULL) { - vproc_log(j, LOG_ERR, "getpwnam(\"%s\") failed", j->username); + job_log(j, LOG_ERR, "getpwnam(\"%s\") failed", j->username); _exit(EXIT_FAILURE); } } else if (j->mach_uid) { if ((pwe = getpwuid(j->mach_uid)) == NULL) { - vproc_log(j, LOG_ERR, "getpwuid(\"%u\") failed", j->mach_uid); + job_log(j, LOG_ERR, "getpwuid(\"%u\") failed", j->mach_uid); _exit(EXIT_FAILURE); } } else { @@ -1604,7 +1604,7 @@ strlcpy(loginname, pwe->pw_name, sizeof(loginname)); if (pwe->pw_expire && time(NULL) >= pwe->pw_expire) { - vproc_log(j, LOG_ERR, "Expired account"); + job_log(j, LOG_ERR, "Expired account"); _exit(EXIT_FAILURE); } @@ -1615,7 +1615,7 @@ struct group *gre; if ((gre = getgrnam(j->groupname)) == NULL) { - vproc_log(j, LOG_ERR, "getgrnam(\"%s\") failed", j->groupname); + job_log(j, LOG_ERR, "getgrnam(\"%s\") failed", j->groupname); _exit(EXIT_FAILURE); } @@ -1623,7 +1623,7 @@ } if (-1 == setgid(desired_gid)) { - vproc_log_error(j, LOG_ERR, "setgid(%u)", desired_gid); + job_log_error(j, LOG_ERR, "setgid(%u)", desired_gid); _exit(EXIT_FAILURE); } @@ -1633,19 +1633,19 @@ if (!j->no_init_groups) { if (initgroups(loginname, desired_gid) == -1) { - vproc_log_error(j, LOG_ERR, "initgroups()"); + job_log_error(j, LOG_ERR, "initgroups()"); _exit(EXIT_FAILURE); } } if (-1 == setuid(desired_uid)) { - vproc_log_error(j, LOG_ERR, "setuid(%u)", desired_uid); + job_log_error(j, LOG_ERR, "setuid(%u)", desired_uid); _exit(EXIT_FAILURE); } } void -vproc_setup_attributes(vproc_t j) +job_setup_attributes(job_t j) { struct limititem *li; struct envitem *ei; @@ -1656,7 +1656,7 @@ struct rlimit rl; if (getrlimit(li->which, &rl) == -1) { - vproc_log_error(j, LOG_WARNING, "getrlimit()"); + job_log_error(j, LOG_WARNING, "getrlimit()"); continue; } @@ -1666,7 +1666,7 @@ rl.rlim_cur = li->lim.rlim_cur; if (setrlimit(li->which, &rl) == -1) - vproc_log_error(j, LOG_WARNING, "setrlimit()"); + job_log_error(j, LOG_WARNING, "setrlimit()"); } if (!j->inetcompat && j->session_create) @@ -1674,7 +1674,7 @@ if (j->low_pri_io) { if (setiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_PROCESS, IOPOL_THROTTLE) == -1) { - vproc_log_error(j, LOG_WARNING, "setiopolicy_np()"); + job_log_error(j, LOG_WARNING, "setiopolicy_np()"); } } if (j->rootdir) { @@ -1682,7 +1682,7 @@ chdir("."); } - vproc_postfork_become_user(j); + job_postfork_become_user(j); if (j->workingdir) { chdir(j->workingdir); @@ -1695,32 +1695,32 @@ if (j->stdinpath) { int sifd = open(j->stdinpath, O_RDONLY|O_NOCTTY); if (sifd == -1) { - vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdinpath); + job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdinpath); } else { - vproc_assumes(j, dup2(sifd, STDIN_FILENO) != -1); - vproc_assumes(j, close(sifd) == 0); + job_assumes(j, dup2(sifd, STDIN_FILENO) != -1); + job_assumes(j, close(sifd) == 0); } } if (j->stdoutpath) { int sofd = open(j->stdoutpath, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, DEFFILEMODE); if (sofd == -1) { - vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdoutpath); + job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stdoutpath); } else { - vproc_assumes(j, dup2(sofd, STDOUT_FILENO) != -1); - vproc_assumes(j, close(sofd) == 0); + job_assumes(j, dup2(sofd, STDOUT_FILENO) != -1); + job_assumes(j, close(sofd) == 0); } } if (j->stderrpath) { int sefd = open(j->stderrpath, O_WRONLY|O_APPEND|O_CREAT|O_NOCTTY, DEFFILEMODE); if (sefd == -1) { - vproc_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stderrpath); + job_log_error(j, LOG_WARNING, "open(\"%s\", ...)", j->stderrpath); } else { - vproc_assumes(j, dup2(sefd, STDERR_FILENO) != -1); - vproc_assumes(j, close(sefd) == 0); + job_assumes(j, dup2(sefd, STDERR_FILENO) != -1); + job_assumes(j, close(sefd) == 0); } } - vproc_setup_env_from_other_jobs(root_job); + job_setup_env_from_other_jobs(root_job); SLIST_FOREACH(ei, &j->env, sle) setenv(ei->key, ei->value, 1); @@ -1729,7 +1729,7 @@ } int -dir_has_files(vproc_t j, const char *path) +dir_has_files(job_t j, const char *path) { DIR *dd = opendir(path); struct dirent *de; @@ -1745,12 +1745,12 @@ } } - vproc_assumes(j, closedir(dd) == 0); + job_assumes(j, closedir(dd) == 0); return r; } void -calendarinterval_setalarm(vproc_t j, struct calendarinterval *ci) +calendarinterval_setalarm(job_t j, struct calendarinterval *ci) { time_t later; @@ -1767,14 +1767,14 @@ } if (-1 == kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_ADD, NOTE_ABSOLUTE|NOTE_SECONDS, later, j)) { - vproc_log_error(j, LOG_ERR, "adding kevent alarm"); + job_log_error(j, LOG_ERR, "adding kevent alarm"); } else { - vproc_log(j, LOG_INFO, "scheduled to run again at %s", ctime(&later)); + job_log(j, LOG_INFO, "scheduled to run again at %s", ctime(&later)); } } size_t -vproc_prep_log_preface(vproc_t j, char *buf) +job_prep_log_preface(job_t j, char *buf) { size_t lsz = strlen(j->label); char newlabel[lsz * 2 + 1]; @@ -1792,13 +1792,13 @@ newlabel[o] = '\0'; if (j->parent) - r = vproc_prep_log_preface(j->parent, buf); + r = job_prep_log_preface(j->parent, buf); return r + sprintf(buf + r, "%s%s", j->parent ? "/" : "", newlabel); } void -vproc_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test) +job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test) { int saved_errno = errno; char buf[100]; @@ -1820,17 +1820,17 @@ *rcs_rev_tmp = '\0'; } - vproc_log(j, LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); + job_log(j, LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); } void -vproc_log_error(vproc_t j, int pri, const char *msg, ...) +job_log_error(job_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; size_t o; - o = vproc_prep_log_preface(j, newmsg); + o = job_prep_log_preface(j, newmsg); sprintf(newmsg + o, ": %s: %s", msg, strerror(errno)); @@ -1840,13 +1840,13 @@ } void -vproc_log(vproc_t j, int pri, const char *msg, ...) +job_log(job_t j, int pri, const char *msg, ...) { char newmsg[10000]; va_list ap; size_t o; - o = vproc_prep_log_preface(j, newmsg); + o = job_prep_log_preface(j, newmsg); sprintf(newmsg + o, ": %s", msg); @@ -1856,11 +1856,11 @@ } bool -watchpath_new(vproc_t j, const char *name, bool qdir) +watchpath_new(job_t j, const char *name, bool qdir) { struct watchpath *wp = calloc(1, sizeof(struct watchpath) + strlen(name) + 1); - if (!vproc_assumes(j, wp != NULL)) + if (!job_assumes(j, wp != NULL)) return false; wp->is_qdir = qdir; @@ -1875,10 +1875,10 @@ } void -watchpath_delete(vproc_t j, struct watchpath *wp) +watchpath_delete(job_t j, struct watchpath *wp) { if (wp->fd != -1) - vproc_assumes(j, close(wp->fd) != -1); + job_assumes(j, close(wp->fd) != -1); SLIST_REMOVE(&j->vnodes, wp, watchpath, sle); @@ -1886,16 +1886,16 @@ } void -watchpath_ignore(vproc_t j, struct watchpath *wp) +watchpath_ignore(job_t j, struct watchpath *wp) { if (wp->fd != -1) { - vproc_log(j, LOG_DEBUG, "Ignoring Vnode: %d", wp->fd); - vproc_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_DELETE, 0, 0, NULL) != -1); + job_log(j, LOG_DEBUG, "Ignoring Vnode: %d", wp->fd); + job_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_DELETE, 0, 0, NULL) != -1); } } void -watchpath_watch(vproc_t j, struct watchpath *wp) +watchpath_watch(job_t j, struct watchpath *wp) { int fflags = NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK; int qdir_file_cnt; @@ -1907,23 +1907,23 @@ wp->fd = _fd(open(wp->name, O_EVTONLY|O_NOCTTY|O_NOFOLLOW)); if (wp->fd == -1) - return vproc_log_error(j, LOG_ERR, "Watchpath monitoring failed on \"%s\"", wp->name); + return job_log_error(j, LOG_ERR, "Watchpath monitoring failed on \"%s\"", wp->name); - vproc_log(j, LOG_DEBUG, "Watching Vnode: %d", wp->fd); - vproc_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, fflags, 0, j) != -1); + job_log(j, LOG_DEBUG, "Watching Vnode: %d", wp->fd); + job_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, fflags, 0, j) != -1); if (!wp->is_qdir) return; if (-1 == (qdir_file_cnt = dir_has_files(j, wp->name))) { - vproc_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); + job_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); } else if (qdir_file_cnt > 0) { - vproc_dispatch(j, true); + job_dispatch(j, true); } } void -watchpath_callback(vproc_t j, struct kevent *kev) +watchpath_callback(job_t j, struct kevent *kev) { struct watchpath *wp; int dir_file_cnt; @@ -1933,30 +1933,30 @@ break; } - vproc_assumes(j, wp != NULL); + job_assumes(j, wp != NULL); if ((NOTE_DELETE|NOTE_RENAME|NOTE_REVOKE) & kev->fflags) { - vproc_log(j, LOG_DEBUG, "Path invalidated: %s", wp->name); - vproc_assumes(j, close(wp->fd) == 0); + job_log(j, LOG_DEBUG, "Path invalidated: %s", wp->name); + job_assumes(j, close(wp->fd) == 0); wp->fd = -1; /* this will get fixed in watchpath_watch() */ } else if (!wp->is_qdir) { - vproc_log(j, LOG_DEBUG, "Watch path modified: %s", wp->name); + job_log(j, LOG_DEBUG, "Watch path modified: %s", wp->name); } else { - vproc_log(j, LOG_DEBUG, "Queue directory modified: %s", wp->name); + job_log(j, LOG_DEBUG, "Queue directory modified: %s", wp->name); if (-1 == (dir_file_cnt = dir_has_files(j, wp->name))) { - vproc_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); + job_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); } else if (0 == dir_file_cnt) { - vproc_log(j, LOG_DEBUG, "Spurious wake up, directory is empty again: %s", wp->name); + job_log(j, LOG_DEBUG, "Spurious wake up, directory is empty again: %s", wp->name); return; } } - vproc_dispatch(j, true); + job_dispatch(j, true); } bool -calendarinterval_new_from_obj(vproc_t j, launch_data_t obj) +calendarinterval_new_from_obj(job_t j, launch_data_t obj) { launch_data_t tmp_k; struct tm tmptm; @@ -1987,11 +1987,11 @@ } bool -calendarinterval_new(vproc_t j, struct tm *w) +calendarinterval_new(job_t j, struct tm *w) { struct calendarinterval *ci = calloc(1, sizeof(struct calendarinterval)); - if (!vproc_assumes(j, ci != NULL)) + if (!job_assumes(j, ci != NULL)) return false; ci->when = *w; @@ -2004,9 +2004,9 @@ } void -calendarinterval_delete(vproc_t j, struct calendarinterval *ci) +calendarinterval_delete(job_t j, struct calendarinterval *ci) { - vproc_assumes(j, kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); + job_assumes(j, kevent_mod((uintptr_t)ci, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); SLIST_REMOVE(&j->cal_intervals, ci, calendarinterval, sle); @@ -2014,7 +2014,7 @@ } void -calendarinterval_callback(vproc_t j, struct kevent *kev) +calendarinterval_callback(job_t j, struct kevent *kev) { struct calendarinterval *ci; @@ -2023,25 +2023,25 @@ break; } - if (vproc_assumes(j, ci != NULL)) { + if (job_assumes(j, ci != NULL)) { calendarinterval_setalarm(j, ci); - vproc_dispatch(j, true); + job_dispatch(j, true); } } bool -socketgroup_new(vproc_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds) +socketgroup_new(job_t j, const char *name, int *fds, unsigned int fd_cnt, bool junkfds) { struct socketgroup *sg = calloc(1, sizeof(struct socketgroup) + strlen(name) + 1); - if (!vproc_assumes(j, sg != NULL)) + if (!job_assumes(j, sg != NULL)) return false; sg->fds = calloc(1, fd_cnt * sizeof(int)); sg->fd_cnt = fd_cnt; sg->junkfds = junkfds; - if (!vproc_assumes(j, sg->fds != NULL)) { + if (!job_assumes(j, sg->fds != NULL)) { free(sg); return false; } @@ -2055,12 +2055,12 @@ } void -socketgroup_delete(vproc_t j, struct socketgroup *sg) +socketgroup_delete(job_t j, struct socketgroup *sg) { unsigned int i; for (i = 0; i < sg->fd_cnt; i++) - vproc_assumes(j, close(sg->fds[i]) != -1); + job_assumes(j, close(sg->fds[i]) != -1); SLIST_REMOVE(&j->sockets, sg, socketgroup, sle); @@ -2069,7 +2069,7 @@ } void -socketgroup_ignore(vproc_t j, struct socketgroup *sg) +socketgroup_ignore(job_t j, struct socketgroup *sg) { char buf[10000]; unsigned int i, buf_off = 0; @@ -2080,14 +2080,14 @@ for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); - vproc_log(j, LOG_DEBUG, "Ignoring Sockets:%s", buf); + job_log(j, LOG_DEBUG, "Ignoring Sockets:%s", buf); for (i = 0; i < sg->fd_cnt; i++) - vproc_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_DELETE, 0, 0, NULL) != -1); + job_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_DELETE, 0, 0, NULL) != -1); } void -socketgroup_watch(vproc_t j, struct socketgroup *sg) +socketgroup_watch(job_t j, struct socketgroup *sg) { char buf[10000]; unsigned int i, buf_off = 0; @@ -2098,24 +2098,24 @@ for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); - vproc_log(j, LOG_DEBUG, "Watching sockets:%s", buf); + job_log(j, LOG_DEBUG, "Watching sockets:%s", buf); for (i = 0; i < sg->fd_cnt; i++) - vproc_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_ADD, 0, 0, j) != -1); + job_assumes(j, kevent_mod(sg->fds[i], EVFILT_READ, EV_ADD, 0, 0, j) != -1); } void -socketgroup_callback(vproc_t j, struct kevent *kev) +socketgroup_callback(job_t j, struct kevent *kev) { - vproc_dispatch(j, true); + job_dispatch(j, true); } bool -envitem_new(vproc_t j, const char *k, const char *v, bool global) +envitem_new(job_t j, const char *k, const char *v, bool global) { struct envitem *ei = calloc(1, sizeof(struct envitem) + strlen(k) + 1 + strlen(v) + 1); - if (!vproc_assumes(j, ei != NULL)) + if (!job_assumes(j, ei != NULL)) return false; strcpy(ei->key, k); @@ -2132,7 +2132,7 @@ } void -envitem_delete(vproc_t j, struct envitem *ei, bool global) +envitem_delete(job_t j, struct envitem *ei, bool global) { if (global) { SLIST_REMOVE(&j->global_env, ei, envitem, sle); @@ -2146,7 +2146,7 @@ void envitem_setup(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; if (launch_data_get_type(obj) != LAUNCH_DATA_STRING) return; @@ -2155,7 +2155,7 @@ } bool -limititem_update(vproc_t j, int w, rlim_t r) +limititem_update(job_t j, int w, rlim_t r) { struct limititem *li; @@ -2167,7 +2167,7 @@ if (li == NULL) { li = calloc(1, sizeof(struct limititem)); - if (!vproc_assumes(j, li != NULL)) + if (!job_assumes(j, li != NULL)) return false; li->which = w; @@ -2185,7 +2185,7 @@ } void -limititem_delete(vproc_t j, struct limititem *li) +limititem_delete(job_t j, struct limititem *li) { SLIST_REMOVE(&j->limits, li, limititem, sle); @@ -2195,7 +2195,7 @@ void limititem_setup(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; int i, limits_cnt = (sizeof(launchd_keys2limits) / sizeof(launchd_keys2limits[0])); rlim_t rl; @@ -2216,19 +2216,19 @@ } bool -vproc_useless(vproc_t j) +job_useless(job_t j) { if (j->unload_at_exit && j->start_time != 0) { - vproc_log(j, LOG_INFO, "Exited. Was only configured to run once."); + job_log(j, LOG_INFO, "Exited. Was only configured to run once."); return true; } else if (shutdown_in_progress) { - vproc_log(j, LOG_INFO, "Exited while shutdown in progress."); + job_log(j, LOG_INFO, "Exited while shutdown in progress."); return true; } else if (!j->checkedin && (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices))) { - vproc_log(j, LOG_WARNING, "Failed to check-in!"); + job_log(j, LOG_WARNING, "Failed to check-in!"); return true; } else if (j->legacy_mach_job && SLIST_EMPTY(&j->machservices)) { - vproc_log(j, LOG_INFO, "Garbage collecting"); + job_log(j, LOG_INFO, "Garbage collecting"); return true; } @@ -2236,7 +2236,7 @@ } bool -vproc_keepalive(vproc_t j) +job_keepalive(job_t j) { mach_msg_type_number_t statusCnt; mach_port_status_t status; @@ -2247,12 +2247,12 @@ bool dispatch_others = false; if (j->runatload && j->start_time == 0) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); + job_log(j, LOG_DEBUG, "KeepAlive check: job needs to run at least once."); return true; } if (!j->ondemand) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run continuously."); + job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run continuously."); return true; } @@ -2262,7 +2262,7 @@ (mach_port_info_t)&status, &statusCnt) != KERN_SUCCESS) continue; if (status.mps_msgcount) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job restarted due to %d queued Mach messages on service: %s", + job_log(j, LOG_DEBUG, "KeepAlive check: job restarted due to %d queued Mach messages on service: %s", status.mps_msgcount, ms->name); return true; } @@ -2276,7 +2276,7 @@ wanted_state = true; case NETWORK_DOWN: if (network_up == wanted_state) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the network is %s.", + job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the network is %s.", wanted_state ? "up" : "down"); return true; } @@ -2285,7 +2285,7 @@ wanted_state = true; case FAILED_EXIT: if (good_exit == wanted_state) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the exit state was %s.", + job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the exit state was %s.", wanted_state ? "successful" : "failure"); return true; } @@ -2294,7 +2294,7 @@ wanted_state = true; case PATH_MISSING: if ((bool)(stat(si->what, &sb) == 0) == wanted_state) { - vproc_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the following path %s: %s", + job_log(j, LOG_DEBUG, "KeepAlive check: job configured to run while the following path %s: %s", wanted_state ? "exists" : "is missing", si->what); return true; } @@ -2305,13 +2305,13 @@ /* Maybe another job has the inverse path based semaphore as this job */ if (dispatch_others) - vproc_dispatch_all_other_semaphores(root_job, j); + job_dispatch_all_other_semaphores(root_job, j); return false; } const char * -vproc_prog(vproc_t j) +job_prog(job_t j) { if (j->prog) { return j->prog; @@ -2323,7 +2323,7 @@ } bool -vproc_active(vproc_t j) +job_active(job_t j) { struct machservice *ms; @@ -2336,9 +2336,9 @@ if (j->priv_port_has_senders) { if (j->start_time && !j->checkedin) { if (j->legacy_mach_job) { - vproc_log(j, LOG_NOTICE, "Daemonized. Extremely expensive no-op."); + job_log(j, LOG_NOTICE, "Daemonized. Extremely expensive no-op."); } else if (!j->unload_at_exit) { - vproc_log(j, LOG_ERR, "Daemonization is not supported under launchd."); + job_log(j, LOG_ERR, "Daemonization is not supported under launchd."); return false; } } @@ -2356,25 +2356,25 @@ pid_t launchd_fork(void) { - return vproc_fork(root_job); + return job_fork(root_job); } pid_t -vproc_fork(vproc_t j) +job_fork(job_t j) { mach_port_t p = j->bs_port; pid_t r = -1; sigprocmask(SIG_BLOCK, &blocked_signals, NULL); - vproc_assumes(j, launchd_mport_make_send(p) == KERN_SUCCESS); - vproc_assumes(j, launchd_set_bport(p) == KERN_SUCCESS); - vproc_assumes(j, launchd_mport_deallocate(p) == KERN_SUCCESS); + job_assumes(j, launchd_mport_make_send(p) == KERN_SUCCESS); + job_assumes(j, launchd_set_bport(p) == KERN_SUCCESS); + job_assumes(j, launchd_mport_deallocate(p) == KERN_SUCCESS); r = fork(); if (r != 0) { - vproc_assumes(j, launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); + job_assumes(j, launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); } else if (r == 0) { size_t i; @@ -2390,16 +2390,16 @@ } void -machservice_resetport(vproc_t j, struct machservice *ms) +machservice_resetport(job_t j, struct machservice *ms) { - vproc_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); - vproc_assumes(j, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); - vproc_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS); - vproc_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS); } struct machservice * -machservice_new(vproc_t j, const char *name, mach_port_t *serviceport) +machservice_new(job_t j, const char *name, mach_port_t *serviceport) { struct machservice *ms; @@ -2410,10 +2410,10 @@ ms->job = j; if (*serviceport == MACH_PORT_NULL) { - if (!vproc_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) goto out_bad; - if (!vproc_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) goto out_bad2; *serviceport = ms->port; ms->isActive = false; @@ -2425,11 +2425,11 @@ SLIST_INSERT_HEAD(&j->machservices, ms, sle); - vproc_log(j, LOG_INFO, "Mach service added: %s", name); + job_log(j, LOG_INFO, "Mach service added: %s", name); return ms; out_bad2: - vproc_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + job_assumes(j, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); out_bad: free(ms); return NULL; @@ -2470,7 +2470,7 @@ em = EXC_MASK_RPC_ALERT; #endif - if (!vproc_assumes(ms->job, mhp != MACH_PORT_NULL)) { + if (!job_assumes(ms->job, mhp != MACH_PORT_NULL)) { return; } @@ -2485,17 +2485,17 @@ case TASK_BOOTSTRAP_PORT: /* I find it a little odd that zero isn't reserved in the header */ case 0: - vproc_log(ms->job, LOG_WARNING, "Tried to set a reserved task special port: %d", which_port); + job_log(ms->job, LOG_WARNING, "Tried to set a reserved task special port: %d", which_port); break; default: - vproc_assumes(ms->job, (errno = task_set_special_port(mts, which_port, ms->port)) == KERN_SUCCESS); + job_assumes(ms->job, (errno = task_set_special_port(mts, which_port, ms->port)) == KERN_SUCCESS); break; } } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_HOSTSPECIALPORT) == 0 && getpid() == 1) { if (which_port > HOST_MAX_SPECIAL_KERNEL_PORT) { - vproc_assumes(ms->job, (errno = host_set_special_port(mhp, which_port, ms->port)) == KERN_SUCCESS); + job_assumes(ms->job, (errno = host_set_special_port(mhp, which_port, ms->port)) == KERN_SUCCESS); } else { - vproc_log(ms->job, LOG_WARNING, "Tried to set a reserved host special port: %d", which_port); + job_log(ms->job, LOG_WARNING, "Tried to set a reserved host special port: %d", which_port); } } case LAUNCH_DATA_BOOL: @@ -2505,34 +2505,34 @@ } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_HIDEUNTILCHECKIN) == 0) { ms->hide = b; } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_EXCEPTIONSERVER) == 0) { - vproc_assumes(ms->job, task_set_exception_ports(mts, em, ms->port, + job_assumes(ms->job, task_set_exception_ports(mts, em, ms->port, EXCEPTION_STATE_IDENTITY, f) == KERN_SUCCESS); } else if (strcasecmp(key, LAUNCH_JOBKEY_MACH_KUNCSERVER) == 0) { ms->kUNCServer = b; - vproc_assumes(ms->job, host_set_UNDServer(mhp, ms->port) == KERN_SUCCESS); + job_assumes(ms->job, host_set_UNDServer(mhp, ms->port) == KERN_SUCCESS); } break; default: break; } - vproc_assumes(ms->job, launchd_mport_deallocate(mhp) == KERN_SUCCESS); + job_assumes(ms->job, launchd_mport_deallocate(mhp) == KERN_SUCCESS); } void machservice_setup(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; struct machservice *ms; mach_port_t p = MACH_PORT_NULL; - if ((ms = vproc_lookup_service(j->parent, key, false))) { - vproc_log(j, LOG_WARNING, "Conflict with job: %s over Mach service: %s", ms->job->label, key); + if ((ms = job_lookup_service(j->parent, key, false))) { + job_log(j, LOG_WARNING, "Conflict with job: %s over Mach service: %s", ms->job->label, key); return; } if ((ms = machservice_new(j, key, &p)) == NULL) { - vproc_log_error(j, LOG_WARNING, "Cannot add service: %s", key); + job_log_error(j, LOG_WARNING, "Cannot add service: %s", key); return; } @@ -2543,35 +2543,35 @@ } } -vproc_t -vproc_parent(vproc_t j) +job_t +job_parent(job_t j) { return j->parent; } void -vproc_uncork_fork(vproc_t j) +job_uncork_fork(job_t j) { pid_t c = j->p; if (j->stall_before_exec) { - vproc_log(j, LOG_DEBUG, "Uncorking the fork()."); + job_log(j, LOG_DEBUG, "Uncorking the fork()."); /* this unblocks the child and avoids a race * between the above fork() and the kevent_mod() */ write(j->execfd, &c, sizeof(c)); j->stall_before_exec = false; } else { - vproc_log(j, LOG_WARNING, "Attempt to uncork a job that isn't in the middle of a fork()."); + job_log(j, LOG_WARNING, "Attempt to uncork a job that isn't in the middle of a fork()."); } } void -vproc_foreach_service(vproc_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) +job_foreach_service(job_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) { struct machservice *ms; - vproc_t ji; + job_t ji; - j = vproc_get_bs(j); + j = job_get_bs(j); if (include_subjobs) { SLIST_FOREACH(ji, &j->jobs, sle) { @@ -2587,52 +2587,52 @@ bs_iter(ms, context); } -vproc_t -vproc_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port) +job_t +job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port) { char bslabel[1024] = "100000"; - vproc_t j; + job_t j; if (requestorport == MACH_PORT_NULL) { if (p) { - vproc_log(p, LOG_ERR, "Mach sub-bootstrap create request requires a requester port"); + job_log(p, LOG_ERR, "Mach sub-bootstrap create request requires a requester port"); } return NULL; } - j = vproc_new(p, bslabel, NULL, NULL, NULL, requestorport); + j = job_new(p, bslabel, NULL, NULL, NULL, requestorport); if (j == NULL) return NULL; if (checkin_port != MACH_PORT_NULL) { j->bs_port = checkin_port; - } else if (!vproc_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) { + } else if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) { goto out_bad; } sprintf(j->label, "%d", MACH_PORT_INDEX(j->bs_port)); - if (!vproc_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) goto out_bad; if (p) { - vproc_log(p, LOG_DEBUG, "Mach sub-bootstrap created: %s", j->label); + job_log(p, LOG_DEBUG, "Mach sub-bootstrap created: %s", j->label); } return j; out_bad: if (j) - vproc_remove(j); + job_remove(j); return NULL; } void -vproc_delete_anything_with_port(vproc_t j, mach_port_t port) +job_delete_anything_with_port(job_t j, mach_port_t port) { struct machservice *ms, *next_ms; - vproc_t ji, jn; + job_t ji, jn; /* Mach ports, unlike Unix descriptors, are reference counted. In other * words, when some program hands us a second or subsequent send right @@ -2645,7 +2645,7 @@ */ SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - vproc_delete_anything_with_port(ji, port); + job_delete_anything_with_port(ji, port); } SLIST_FOREACH_SAFE(ms, &j->machservices, sle, next_ms) { @@ -2657,19 +2657,19 @@ if (j == root_job) { launchd_shutdown(); } else { - vproc_remove(j); + job_remove(j); } } } struct machservice * -vproc_lookup_service(vproc_t j, const char *name, bool check_parent) +job_lookup_service(job_t j, const char *name, bool check_parent) { struct machservice *ms; - vproc_t ji; + job_t ji; - j = vproc_get_bs(j); + j = job_get_bs(j); SLIST_FOREACH(ji, &j->jobs, sle) { if (ji->req_port) @@ -2692,7 +2692,7 @@ if (!check_parent) return NULL; - return vproc_lookup_service(j->parent, name, true); + return job_lookup_service(j->parent, name, true); } mach_port_t @@ -2701,7 +2701,7 @@ return ms->port; } -vproc_t +job_t machservice_job(struct machservice *ms) { return ms->job; @@ -2731,15 +2731,15 @@ if (ms->recv) { if (ms->isActive) { /* FIXME we should cancel the notification */ - vproc_log(ms->job, LOG_ERR, "Mach service deleted while we didn't own the receive right: %s", ms->name); + job_log(ms->job, LOG_ERR, "Mach service deleted while we didn't own the receive right: %s", ms->name); } else { - vproc_assumes(ms->job, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); + job_assumes(ms->job, launchd_mport_close_recv(ms->port) == KERN_SUCCESS); } } - vproc_assumes(ms->job, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); + job_assumes(ms->job, launchd_mport_deallocate(ms->port) == KERN_SUCCESS); - vproc_log(ms->job, LOG_INFO, "Mach service deleted: %s", ms->name); + job_log(ms->job, LOG_INFO, "Mach service deleted: %s", ms->name); SLIST_REMOVE(&ms->job->machservices, ms, machservice, sle); @@ -2755,10 +2755,10 @@ if (ms->job->req_port == MACH_PORT_NULL) { which = MACH_NOTIFY_PORT_DESTROYED; - vproc_checkin(ms->job); + job_checkin(ms->job); } - vproc_assumes(ms->job, launchd_mport_notify_req(ms->port, which) == KERN_SUCCESS); + job_assumes(ms->job, launchd_mport_notify_req(ms->port, which) == KERN_SUCCESS); } #define NELEM(x) (sizeof(x)/sizeof(x[0])) @@ -2810,19 +2810,19 @@ } void -vproc_checkin(vproc_t j) +job_checkin(job_t j) { j->checkedin = true; } bool -vproc_ack_port_destruction(vproc_t j, mach_port_t p) +job_ack_port_destruction(job_t j, mach_port_t p) { - vproc_t ji; + job_t ji; struct machservice *ms; SLIST_FOREACH(ji, &j->jobs, sle) { - if (vproc_ack_port_destruction(ji, p)) + if (job_ack_port_destruction(ji, p)) return true; } @@ -2839,25 +2839,25 @@ if (ms->reset) machservice_resetport(j, ms); - vproc_log(j, LOG_DEBUG, "Receive right returned to us: %s", ms->name); + job_log(j, LOG_DEBUG, "Receive right returned to us: %s", ms->name); - vproc_dispatch(j, false); + job_dispatch(j, false); return true; } void -vproc_ack_no_senders(vproc_t j) +job_ack_no_senders(job_t j) { j->priv_port_has_senders = false; - vproc_log(j, LOG_DEBUG, "No more senders on privileged Mach bootstrap port"); + job_log(j, LOG_DEBUG, "No more senders on privileged Mach bootstrap port"); - vproc_dispatch(j, false); + job_dispatch(j, false); } mach_port_t -vproc_get_reqport(vproc_t j) +job_get_reqport(job_t j) { j->transfer_bstrap = true; gc_this_job = j; @@ -2866,31 +2866,31 @@ } mach_port_t -vproc_get_bsport(vproc_t j) +job_get_bsport(job_t j) { return j->bs_port; } -vproc_t -vproc_get_bs(vproc_t j) +job_t +job_get_bs(job_t j) { if (j->req_port) return j; - if (vproc_assumes(j, j->parent != NULL)) + if (job_assumes(j, j->parent != NULL)) return j->parent; return NULL; } pid_t -vproc_get_pid(vproc_t j) +job_get_pid(job_t j) { return j->p; } bool -semaphoreitem_new(vproc_t j, semaphore_reason_t why, const char *what) +semaphoreitem_new(job_t j, semaphore_reason_t why, const char *what) { struct semaphoreitem *si; size_t alloc_sz = sizeof(struct semaphoreitem); @@ -2898,7 +2898,7 @@ if (what) alloc_sz += strlen(what) + 1; - if (!vproc_assumes(j, si = calloc(1, alloc_sz))) + if (!job_assumes(j, si = calloc(1, alloc_sz))) return false; si->why = why; @@ -2912,7 +2912,7 @@ } void -semaphoreitem_delete(vproc_t j, struct semaphoreitem *ri) +semaphoreitem_delete(job_t j, struct semaphoreitem *ri) { SLIST_REMOVE(&j->semaphores, ri, semaphoreitem, sle); @@ -2922,7 +2922,7 @@ void semaphoreitem_setup_paths(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; semaphore_reason_t why; why = launch_data_get_bool(obj) ? PATH_EXISTS : PATH_MISSING; @@ -2933,7 +2933,7 @@ void semaphoreitem_setup(launch_data_t obj, const char *key, void *context) { - vproc_t j = context; + job_t j = context; semaphore_reason_t why; if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE_NETWORKSTATE) == 0) { @@ -2950,19 +2950,19 @@ } void -vproc_dispatch_all_other_semaphores(vproc_t j, vproc_t nj) +job_dispatch_all_other_semaphores(job_t j, job_t nj) { - vproc_t ji, jn; + job_t ji, jn; if (j == nj) return; SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { - vproc_dispatch_all_other_semaphores(ji, nj); + job_dispatch_all_other_semaphores(ji, nj); } if (!SLIST_EMPTY(&j->semaphores)) { - vproc_dispatch(j, false); + job_dispatch(j, false); } } Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-06 18:12:47 UTC (rev 22841) @@ -24,64 +24,64 @@ #include "bootstrap_public.h" -#define vproc_assumes(j, e) \ - (__builtin_expect(!(e), 0) ? vproc_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) +#define job_assumes(j, e) \ + (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) -typedef struct vproc_s *vproc_t; +typedef struct job_s *job_t; struct machservice; -struct machservice *machservice_new(vproc_t j, const char *name, mach_port_t *serviceport); +struct machservice *machservice_new(job_t j, const char *name, mach_port_t *serviceport); void machservice_delete(struct machservice *); void machservice_watch(struct machservice *); mach_port_t machservice_port(struct machservice *); -vproc_t machservice_job(struct machservice *); +job_t machservice_job(struct machservice *); bool machservice_hidden(struct machservice *); bool machservice_active(struct machservice *); const char *machservice_name(struct machservice *); bootstrap_status_t machservice_status(struct machservice *); -vproc_t vproc_find(vproc_t j, const char *label); -vproc_t vproc_find_by_pid(vproc_t j, pid_t p); -vproc_t vproc_find_by_port(mach_port_t mp); -vproc_t vproc_import(launch_data_t pload); -launch_data_t vproc_import_bulk(launch_data_t pload); -vproc_t vproc_new(vproc_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); -vproc_t vproc_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); -vproc_t vproc_new_via_mach_init(vproc_t jbs, const char *cmd, uid_t uid, bool ond); -vproc_t vproc_new_bootstrap(vproc_t p, mach_port_t requestorport, mach_port_t checkin_port); -launch_data_t vproc_export(vproc_t j); -launch_data_t vproc_export_all(void); -void vproc_dispatch(vproc_t j, bool kickstart); -void vproc_dispatch_all_other_semaphores(vproc_t j, vproc_t nj); -void vproc_stop(vproc_t j); -bool vproc_active(vproc_t j); -void vproc_checkin(vproc_t j); -const char *vproc_prog(vproc_t j); -void vproc_remove(vproc_t j); -void vproc_remove_all_inactive(vproc_t j); -bool vproc_ack_port_destruction(vproc_t j, mach_port_t p); -void vproc_ack_no_senders(vproc_t j); -pid_t vproc_get_pid(vproc_t j); -mach_port_t vproc_get_bsport(vproc_t j); -mach_port_t vproc_get_reqport(vproc_t j); -vproc_t vproc_get_bs(vproc_t j); -void vproc_delete_anything_with_port(vproc_t jbs, mach_port_t port); -vproc_t vproc_parent(vproc_t j); -void vproc_uncork_fork(vproc_t j); -struct machservice *vproc_lookup_service(vproc_t jbs, const char *name, bool check_parent); -void vproc_foreach_service(vproc_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); -void vproc_log(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void vproc_log_error(vproc_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void vproc_log_bug(vproc_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); -kern_return_t vproc_handle_mpm_wait(vproc_t j, mach_port_t srp, int *waitstatus); +job_t job_find(job_t j, const char *label); +job_t job_find_by_pid(job_t j, pid_t p); +job_t job_find_by_port(mach_port_t mp); +job_t job_import(launch_data_t pload); +launch_data_t job_import_bulk(launch_data_t pload); +job_t job_new(job_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); +job_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); +job_t job_new_via_mach_init(job_t jbs, const char *cmd, uid_t uid, bool ond); +job_t job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port); +launch_data_t job_export(job_t j); +launch_data_t job_export_all(void); +void job_dispatch(job_t j, bool kickstart); +void job_dispatch_all_other_semaphores(job_t j, job_t nj); +void job_stop(job_t j); +bool job_active(job_t j); +void job_checkin(job_t j); +const char *job_prog(job_t j); +void job_remove(job_t j); +void job_remove_all_inactive(job_t j); +bool job_ack_port_destruction(job_t j, mach_port_t p); +void job_ack_no_senders(job_t j); +pid_t job_get_pid(job_t j); +mach_port_t job_get_bsport(job_t j); +mach_port_t job_get_reqport(job_t j); +job_t job_get_bs(job_t j); +void job_delete_anything_with_port(job_t jbs, mach_port_t port); +job_t job_parent(job_t j); +void job_uncork_fork(job_t j); +struct machservice *job_lookup_service(job_t jbs, const char *name, bool check_parent); +void job_foreach_service(job_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); +void job_log(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); +kern_return_t job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus); extern size_t total_children; -extern vproc_t root_job; +extern job_t root_job; -extern vproc_t gc_this_job; +extern job_t gc_this_job; #endif Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-06 18:12:47 UTC (rev 22841) @@ -88,10 +88,10 @@ static void **port_to_obj = NULL; static pthread_t demand_thread; -static bool trusted_client_check(vproc_t j, struct ldcred *ldc); +static bool trusted_client_check(job_t j, struct ldcred *ldc); -vproc_t -vproc_find_by_port(mach_port_t mp) +job_t +job_find_by_port(mach_port_t mp) { return port_to_obj[MACH_PORT_INDEX(mp)]; } @@ -116,7 +116,7 @@ continue; if (status.mps_msgcount) { - EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, vproc_find_by_port(members[i])); + EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_find_by_port(members[i])); (*((kq_callback *)kev.udata))(kev.udata, &kev); /* the callback may have tainted our ability to continue this for loop */ break; @@ -142,7 +142,7 @@ init_ports(); - launchd_assert((root_job = vproc_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); + launchd_assert((root_job = job_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); launchd_assumes(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); @@ -330,19 +330,19 @@ x_bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, audit_token_t au_tok, mach_port_t *server_portp) { - vproc_t js, j = vproc_find_by_port(bp); + job_t js, j = job_find_by_port(bp); struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); - vproc_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); + job_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); #define LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 /* XXX - This code should go away once the per session launchd is integrated with the rest of the system */ #ifdef LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 if (getpid() == 1) { if (ldc.euid != 0 && ldc.euid != server_uid) { - vproc_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", + job_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", server_cmd, ldc.euid, server_uid); server_uid = ldc.euid; } @@ -351,17 +351,17 @@ if (!trusted_client_check(j, &ldc)) { return BOOTSTRAP_NOT_PRIVILEGED; } else if (server_uid != getuid()) { - vproc_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", + job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", server_cmd, getuid(), server_uid); server_uid = getuid(); } - js = vproc_new_via_mach_init(j, server_cmd, server_uid, on_demand); + js = job_new_via_mach_init(j, server_cmd, server_uid, on_demand); if (js == NULL) return BOOTSTRAP_NO_MEMORY; - *server_portp = vproc_get_bsport(js); + *server_portp = job_get_bsport(js); return BOOTSTRAP_SUCCESS; } @@ -382,13 +382,13 @@ kern_return_t x_bootstrap_unprivileged(mach_port_t bp, mach_port_t *unprivportp) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); - vproc_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); + job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); - j = vproc_get_bs(j); + j = job_get_bs(j); - *unprivportp = vproc_get_bsport(j); + *unprivportp = job_get_bsport(j); return BOOTSTRAP_SUCCESS; } @@ -398,7 +398,7 @@ x_bootstrap_check_in(mach_port_t bp, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) { static pid_t last_warned_pid = 0; - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -406,15 +406,15 @@ trusted_client_check(j, &ldc); - ms = vproc_lookup_service(j, servicename, true); + ms = job_lookup_service(j, servicename, true); if (ms == NULL) { - vproc_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); + job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); return BOOTSTRAP_UNKNOWN_SERVICE; } if (machservice_job(ms) != j) { if (last_warned_pid != ldc.pid) { - vproc_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", + job_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", ldc.pid, servicename); last_warned_pid = ldc.pid; } @@ -422,13 +422,13 @@ } if (!canReceive(machservice_port(ms))) { launchd_assumes(machservice_active(ms)); - vproc_log(j, LOG_DEBUG, "Check-in of Mach service failed. Already active: %s", servicename); + job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Already active: %s", servicename); return BOOTSTRAP_SERVICE_ACTIVE; } machservice_watch(ms); - vproc_log(j, LOG_INFO, "Check-in of service: %s", servicename); + job_log(j, LOG_INFO, "Check-in of service: %s", servicename); *serviceportp = machservice_port(ms); return BOOTSTRAP_SUCCESS; @@ -437,7 +437,7 @@ kern_return_t x_bootstrap_register(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -445,24 +445,24 @@ trusted_client_check(j, &ldc); - vproc_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); + job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); - ms = vproc_lookup_service(j, servicename, false); + ms = job_lookup_service(j, servicename, false); if (ms) { if (machservice_job(ms) != j) return BOOTSTRAP_NOT_PRIVILEGED; if (machservice_active(ms)) { - vproc_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); + job_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); launchd_assumes(!canReceive(machservice_port(ms))); return BOOTSTRAP_SERVICE_ACTIVE; } - vproc_checkin(machservice_job(ms)); + job_checkin(machservice_job(ms)); machservice_delete(ms); } if (serviceport != MACH_PORT_NULL) { - if ((ms = machservice_new(vproc_get_bs(j), servicename, &serviceport))) { + if ((ms = machservice_new(job_get_bs(j), servicename, &serviceport))) { machservice_watch(ms); } else { return BOOTSTRAP_NO_MEMORY; @@ -475,7 +475,7 @@ kern_return_t x_bootstrap_look_up(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -483,24 +483,24 @@ trusted_client_check(j, &ldc); - ms = vproc_lookup_service(j, servicename, true); + ms = job_lookup_service(j, servicename, true); - if (ms && machservice_hidden(ms) && !vproc_active(machservice_job(ms))) { + if (ms && machservice_hidden(ms) && !job_active(machservice_job(ms))) { ms = NULL; } if (ms) { launchd_assumes(machservice_port(ms) != MACH_PORT_NULL); - vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); *serviceportp = machservice_port(ms); *ptype = MACH_MSG_TYPE_COPY_SEND; return BOOTSTRAP_SUCCESS; } else if (inherited_bootstrap_port != MACH_PORT_NULL) { - vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); *ptype = MACH_MSG_TYPE_MOVE_SEND; return bootstrap_look_up(inherited_bootstrap_port, servicename, serviceportp); } else { - vproc_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); return BOOTSTRAP_UNKNOWN_SERVICE; } } @@ -508,18 +508,18 @@ kern_return_t x_bootstrap_parent(mach_port_t bp, mach_port_t *parentport, mach_msg_type_name_t *pptype) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); - vproc_log(j, LOG_DEBUG, "Requested parent bootstrap port"); + job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); - j = vproc_get_bs(j); + j = job_get_bs(j); *pptype = MACH_MSG_TYPE_MAKE_SEND; - if (vproc_parent(j)) { - *parentport = vproc_get_bsport(vproc_parent(j)); + if (job_parent(j)) { + *parentport = job_get_bsport(job_parent(j)); } else if (MACH_PORT_NULL == inherited_bootstrap_port) { - *parentport = vproc_get_bsport(j); + *parentport = job_get_bsport(j); } else { *pptype = MACH_MSG_TYPE_COPY_SEND; *parentport = inherited_bootstrap_port; @@ -564,12 +564,12 @@ bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - vproc_t ji, j = vproc_find_by_port(bp); + job_t ji, j = job_find_by_port(bp); kern_return_t result; unsigned int cnt = 0; - for (ji = j; ji; ji = vproc_parent(ji)) - vproc_foreach_service(ji, x_bootstrap_info_countservices, &cnt, true); + for (ji = j; ji; ji = job_parent(ji)) + job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, true); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -579,8 +579,8 @@ if (!launchd_assumes(result == KERN_SUCCESS)) goto out_bad; - for (ji = j; ji; ji = vproc_parent(ji)) - vproc_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, true); + for (ji = j; ji; ji = job_parent(ji)) + job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, true); launchd_assumes(info_resp.i == cnt); @@ -603,21 +603,21 @@ mach_port_array_t *ports, unsigned int *ports_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); unsigned int cnt = 0; kern_return_t result; if (getpid() != 1) { - vproc_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); + job_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); return BOOTSTRAP_NOT_PRIVILEGED; - } else if (!vproc_parent(j)) { - vproc_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); + } else if (!job_parent(j)) { + job_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); return BOOTSTRAP_NOT_PRIVILEGED; } - vproc_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); + job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); - vproc_foreach_service(j, x_bootstrap_info_countservices, &cnt, false); + job_foreach_service(j, x_bootstrap_info_countservices, &cnt, false); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -627,7 +627,7 @@ if (!launchd_assumes(result == KERN_SUCCESS)) goto out_bad; - vproc_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, false); + job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, false); launchd_assumes(info_resp.i == cnt); @@ -635,8 +635,8 @@ *ports = info_resp.ports; *servicenames_cnt = *ports_cnt = cnt; - *reqport = vproc_get_reqport(j); - *rcvright = vproc_get_bsport(j); + *reqport = job_get_reqport(j); + *rcvright = job_get_bsport(j); launchd_assumes(launchd_mport_request_callback(*rcvright, NULL, true) == KERN_SUCCESS); @@ -654,48 +654,48 @@ kern_return_t x_bootstrap_subset(mach_port_t bp, mach_port_t requestorport, mach_port_t *subsetportp) { - vproc_t js, j = vproc_find_by_port(bp); + job_t js, j = job_find_by_port(bp); int bsdepth = 0; - while ((j = vproc_parent(j)) != NULL) + while ((j = job_parent(j)) != NULL) bsdepth++; - j = vproc_find_by_port(bp); + j = job_find_by_port(bp); /* Since we use recursion, we need an artificial depth for subsets */ if (bsdepth > 100) { - vproc_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); + job_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); return BOOTSTRAP_NO_MEMORY; } - if ((js = vproc_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { + if ((js = job_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { if (requestorport == MACH_PORT_NULL) return BOOTSTRAP_NOT_PRIVILEGED; return BOOTSTRAP_NO_MEMORY; } - *subsetportp = vproc_get_bsport(js); + *subsetportp = job_get_bsport(js); return BOOTSTRAP_SUCCESS; } kern_return_t x_bootstrap_create_service(mach_port_t bp, name_t servicename, mach_port_t *serviceportp) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); struct machservice *ms; - if (vproc_prog(j)[0] == '\0') { - vproc_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); + if (job_prog(j)[0] == '\0') { + job_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); return BOOTSTRAP_NOT_PRIVILEGED; } - ms = vproc_lookup_service(j, servicename, false); + ms = job_lookup_service(j, servicename, false); if (ms) { - vproc_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); + job_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); return BOOTSTRAP_NAME_IN_USE; } - vproc_checkin(j); + job_checkin(j); *serviceportp = MACH_PORT_NULL; ms = machservice_new(j, servicename, serviceportp); @@ -713,23 +713,23 @@ kern_return_t x_mpm_wait(mach_port_t bp, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); #if 0 struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); #endif - return vproc_handle_mpm_wait(j, srp, waitstatus); + return job_handle_mpm_wait(j, srp, waitstatus); } kern_return_t x_mpm_uncork_fork(mach_port_t bp, audit_token_t au_tok) { - vproc_t j = vproc_find_by_port(bp); + job_t j = job_find_by_port(bp); if (!j) return BOOTSTRAP_NOT_PRIVILEGED; - vproc_uncork_fork(j); + job_uncork_fork(j); return 0; } @@ -740,7 +740,7 @@ uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, pid_t *child_pid, mach_port_t *obsvr_port) { - vproc_t jr, j = vproc_find_by_port(bp); + job_t jr, j = job_find_by_port(bp); struct ldcred ldc; size_t offset = 0; char *tmpp; @@ -754,7 +754,7 @@ #if 0 if (ldc.asid != inherited_asid) { - vproc_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", + job_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", ldc.pid, ldc.asid, inherited_asid); return BOOTSTRAP_NOT_PRIVILEGED; } @@ -790,7 +790,7 @@ } } - jr = vproc_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, + jr = job_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, flags & SPAWN_WANTS_WAIT4DEBUGGER, flags & SPAWN_WANTS_FORCE_PPC); if (jr == NULL) switch (errno) { @@ -800,12 +800,12 @@ return BOOTSTRAP_NO_MEMORY; } - vproc_log(j, LOG_INFO, "Spawned with flags:%s%s", + job_log(j, LOG_INFO, "Spawned with flags:%s%s", flags & SPAWN_WANTS_FORCE_PPC ? " ppc": "", flags & SPAWN_WANTS_WAIT4DEBUGGER ? " stopped": ""); - *child_pid = vproc_get_pid(jr); - *obsvr_port = vproc_get_bsport(jr); + *child_pid = job_get_pid(jr); + *obsvr_port = job_get_bsport(jr); return BOOTSTRAP_SUCCESS; } @@ -815,7 +815,7 @@ { /* This message is sent to us when a receive right is returned to us. */ - if (!vproc_ack_port_destruction(root_job, rights)) { + if (!job_ack_port_destruction(root_job, rights)) { launchd_assumes(launchd_mport_close_recv(rights) == KERN_SUCCESS); } @@ -837,7 +837,7 @@ kern_return_t do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) { - vproc_t j = vproc_find_by_port(notify); + job_t j = job_find_by_port(notify); /* This message is sent to us when the last customer of one of our objects * goes away. @@ -846,7 +846,7 @@ if (!launchd_assumes(j != NULL)) return KERN_FAILURE; - vproc_ack_no_senders(j); + job_ack_no_senders(j); return KERN_SUCCESS; } @@ -874,7 +874,7 @@ inherited_bootstrap_port = MACH_PORT_NULL; } - vproc_delete_anything_with_port(root_job, name); + job_delete_anything_with_port(root_job, name); /* A dead-name notification about a port appears to increment the * rights on said port. Let's deallocate it so that we don't leak @@ -886,7 +886,7 @@ } bool -trusted_client_check(vproc_t j, struct ldcred *ldc) +trusted_client_check(job_t j, struct ldcred *ldc) { static pid_t last_warned_pid = 0; @@ -908,7 +908,7 @@ if (last_warned_pid == ldc->pid) return false; - vproc_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); + job_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); last_warned_pid = ldc->pid; Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-06 18:12:47 UTC (rev 22841) @@ -181,7 +181,7 @@ } void -ipc_open(int fd, vproc_t j) +ipc_open(int fd, job_t j) { struct conncb *c = calloc(1, sizeof(struct conncb)); @@ -324,7 +324,7 @@ { struct readmsg_context *rmc = context; launch_data_t resp = NULL; - vproc_t j; + job_t j; if (rmc->resp) return; @@ -332,8 +332,8 @@ if (data == NULL) { if (!strcmp(cmd, LAUNCH_KEY_CHECKIN)) { if (rmc->c->j) { - resp = vproc_export(rmc->c->j); - vproc_checkin(rmc->c->j); + resp = job_export(rmc->c->j); + job_checkin(rmc->c->j); } else { resp = launch_data_new_errno(EACCES); } @@ -347,7 +347,7 @@ launchd_single_user(); resp = launch_data_new_errno(0); } else if (!strcmp(cmd, LAUNCH_KEY_GETJOBS)) { - resp = vproc_export_all(); + resp = job_export_all(); ipc_revoke_fds(resp); } else if (!strcmp(cmd, LAUNCH_KEY_GETRESOURCELIMITS)) { resp = adjust_rlimits(NULL); @@ -383,28 +383,28 @@ launch_data_set_bool(resp, batch_disabler_count == 0); } } else if (!strcmp(cmd, LAUNCH_KEY_STARTJOB)) { - if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { - vproc_dispatch(j, true); + if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { + job_dispatch(j, true); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_STOPJOB)) { - if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { - vproc_stop(j); + if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { + job_stop(j); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_REMOVEJOB)) { - if ((j = vproc_find(root_job, launch_data_get_string(data))) != NULL) { - vproc_remove(j); + if ((j = job_find(root_job, launch_data_get_string(data))) != NULL) { + job_remove(j); errno = 0; } resp = launch_data_new_errno(errno); } else if (!strcmp(cmd, LAUNCH_KEY_SUBMITJOB)) { if (launch_data_get_type(data) == LAUNCH_DATA_ARRAY) { - resp = vproc_import_bulk(data); + resp = job_import_bulk(data); } else { - if (vproc_import(data)) + if (job_import(data)) errno = 0; resp = launch_data_new_errno(errno); } @@ -417,17 +417,17 @@ } else if (!strcmp(cmd, LAUNCH_KEY_SETRESOURCELIMITS)) { resp = adjust_rlimits(data); } else if (!strcmp(cmd, LAUNCH_KEY_GETJOB)) { - if ((j = vproc_find(root_job, launch_data_get_string(data))) == NULL) { + if ((j = job_find(root_job, launch_data_get_string(data))) == NULL) { resp = launch_data_new_errno(errno); } else { - resp = vproc_export(j); + resp = job_export(j); ipc_revoke_fds(resp); } } else if (!strcmp(cmd, LAUNCH_KEY_GETJOBWITHHANDLES)) { - if ((j = vproc_find(root_job, launch_data_get_string(data))) == NULL) { + if ((j = job_find(root_job, launch_data_get_string(data))) == NULL) { resp = launch_data_new_errno(errno); } else { - resp = vproc_export(j); + resp = job_export(j); } } else if (!strcmp(cmd, LAUNCH_KEY_SETLOGMASK)) { resp = launch_data_new_integer(setlogmask(launch_data_get_integer(data))); @@ -438,7 +438,7 @@ } else if (!strcmp(cmd, LAUNCH_KEY_SETSTDERR)) { resp = launchd_setstdio(STDERR_FILENO, data); } else if (!strcmp(cmd, LAUNCH_KEY_BATCHCONTROL)) { - batch_vproc_enable(launch_data_get_bool(data), rmc->c); + batch_job_enable(launch_data_get_bool(data), rmc->c); resp = launch_data_new_errno(0); } @@ -448,7 +448,7 @@ void ipc_close(struct conncb *c) { - batch_vproc_enable(true, c); + batch_job_enable(true, c); SLIST_REMOVE(&connections, c, conncb, sle); launchd_close(c->conn); Modified: trunk/launchd/src/launchd_unix_ipc.h =================================================================== --- trunk/launchd/src/launchd_unix_ipc.h 2006-09-06 17:22:43 UTC (rev 22840) +++ trunk/launchd/src/launchd_unix_ipc.h 2006-09-06 18:12:47 UTC (rev 22841) @@ -24,13 +24,13 @@ kq_callback kqconn_callback; SLIST_ENTRY(conncb) sle; launch_t conn; - vproc_t j; + job_t j; int disabled_batch:1, futureflags:31; }; extern char *sockpath; -void ipc_open(int fd, vproc_t j); +void ipc_open(int fd, job_t j); void ipc_close(struct conncb *c); void ipc_callback(void *, struct kevent *); void ipc_readmsg(launch_data_t msg, void *context); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/b9bb08f5/attachment.html From source_changes at macosforge.org Wed Sep 6 16:16:55 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:30 2007 Subject: [launchd-changes] [22842] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060906231655.A27B921BECB2@cvs.opensource.apple.com> Revision: 22842 Author: zarzycki@apple.com Date: 2006-09-06 16:16:53 -0700 (Wed, 06 Sep 2006) Log Message: ----------- Fix a simple bug and refine when we log a warning. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-06 18:12:47 UTC (rev 22841) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-06 23:16:53 UTC (rev 22842) @@ -847,7 +847,7 @@ case 'i': case 'I': if (strcasecmp(key, LAUNCH_JOBKEY_INITGROUPS) == 0) { - if (getuid() == 0) { + if (getuid() != 0) { job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; } @@ -908,9 +908,11 @@ case 'u': case 'U': if (strcasecmp(key, LAUNCH_JOBKEY_USERNAME) == 0) { - if (getuid() != 0 || strcmp(value, "root") == 0) { + if (getuid() != 0) { job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; + } else if (strcmp(value, "root") == 0) { + return; } where2put = &j->username; } @@ -918,9 +920,11 @@ case 'g': case 'G': if (strcasecmp(key, LAUNCH_JOBKEY_GROUPNAME) == 0) { - if (getuid() != 0 || strcmp(value, "wheel") == 0) { + if (getuid() != 0) { job_log(j, LOG_WARNING, "Ignored this key: %s", key); return; + } else if (strcmp(value, "wheel") == 0) { + return; } where2put = &j->groupname; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/8db0a801/attachment.html From source_changes at macosforge.org Wed Sep 6 16:18:10 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:30 2007 Subject: [launchd-changes] [22843] tags/launchd-158/ Message-ID: <20060906231810.0D8E021BECDA@cvs.opensource.apple.com> Revision: 22843 Author: zarzycki@apple.com Date: 2006-09-06 16:18:08 -0700 (Wed, 06 Sep 2006) Log Message: ----------- "Tagging launchd-158 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-158/ Copied: tags/launchd-158 (from rev 22842, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060906/15b7f967/attachment.html From source_changes at macosforge.org Thu Sep 7 12:52:50 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22844] trunk/launchd Message-ID: <20060907195250.077BE21C2371@cvs.opensource.apple.com> Revision: 22844 Author: zarzycki@apple.com Date: 2006-09-07 12:52:41 -0700 (Thu, 07 Sep 2006) Log Message: ----------- Update automake/autoconf/aclocal goo. Modified Paths: -------------- trunk/launchd/Makefile.in trunk/launchd/aclocal.m4 trunk/launchd/configure trunk/launchd/src/Makefile.in Modified: trunk/launchd/Makefile.in =================================================================== --- trunk/launchd/Makefile.in 2006-09-06 23:18:08 UTC (rev 22843) +++ trunk/launchd/Makefile.in 2006-09-07 19:52:41 UTC (rev 22844) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,102 +13,180 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -SHELL = @SHELL@ - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ + ChangeLog INSTALL NEWS TODO compile depcomp install-sh missing \ + mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/src/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBS_ONLY_FALSE = @LIBS_ONLY_FALSE@ +LIBS_ONLY_TRUE = @LIBS_ONLY_TRUE@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__include = @am__include@ +am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ SUBDIRS = src -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/src/config.h -CONFIG_CLEAN_FILES = -DIST_SOURCES = - -RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ - uninstall-info-recursive all-recursive install-data-recursive \ - install-exec-recursive installdirs-recursive install-recursive \ - uninstall-recursive check-recursive installcheck-recursive -DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ - Makefile.in NEWS TODO aclocal.m4 compile configure configure.ac \ - depcomp install-sh missing mkinstalldirs -DIST_SUBDIRS = $(SUBDIRS) all: all-recursive .SUFFIXES: - -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; -$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + +$(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) - -$(ACLOCAL_M4): configure.ac +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) uninstall-info-am: @@ -119,7 +197,13 @@ # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -131,7 +215,7 @@ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ @@ -139,7 +223,13 @@ mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $$MAKEFLAGS; amf=$$2; \ + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ @@ -160,18 +250,17 @@ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -180,14 +269,23 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ @@ -196,8 +294,24 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -206,29 +320,23 @@ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -top_distdir = . -distdir = $(PACKAGE)-$(VERSION) - -am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } - -GZIP_ENV = --best -distcleancheck_listfiles = find . -type f -print - distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) - @list='$(DISTFILES)'; for file in $$list; do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -243,15 +351,17 @@ || exit 1; \ fi; \ done - list='$(SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" \ - distdir=../$(distdir)/$$subdir \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ @@ -262,26 +372,54 @@ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + dist dist-all: distdir - $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist - $(am__remove_distdir) - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/=build - mkdir $(distdir)/=inst + mkdir $(distdir)/_build + mkdir $(distdir)/_inst chmod a-w $(distdir) - dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ - && cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ @@ -289,23 +427,40 @@ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ - || { echo "ERROR: files left after uninstall:" ; \ - find $$dc_install_base -type f -print ; \ - exit 1; } >&2 ) \ - && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ - && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) - @echo "$(distdir).tar.gz is ready for distribution" | \ - sed 'h;s/./=/g;p;x;p;x' + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 distcleancheck: distclean - if test '$(srcdir)' = . ; then \ + @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi - test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after distclean:" ; \ + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am @@ -313,7 +468,6 @@ all-am: Makefile installdirs: installdirs-recursive installdirs-am: - install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive @@ -325,7 +479,7 @@ installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -333,7 +487,7 @@ clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -344,12 +498,15 @@ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: +html: html-recursive + info: info-recursive info-am: @@ -366,31 +523,39 @@ maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf autom4te.cache + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive -.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ - clean-generic clean-recursive dist dist-all dist-gzip distcheck \ - distclean distclean-generic distclean-recursive distclean-tags \ - distcleancheck distdir dvi dvi-am dvi-recursive info info-am \ - info-recursive install install-am install-data install-data-am \ - install-data-recursive install-exec install-exec-am \ - install-exec-recursive install-info install-info-am \ - install-info-recursive install-man install-recursive \ +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-recursive distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-exec \ + install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ - installdirs-am installdirs-recursive maintainer-clean \ - maintainer-clean-generic maintainer-clean-recursive mostlyclean \ - mostlyclean-generic mostlyclean-recursive tags tags-recursive \ - uninstall uninstall-am uninstall-info-am \ - uninstall-info-recursive uninstall-recursive + installdirs-am maintainer-clean maintainer-clean-generic \ + maintainer-clean-recursive mostlyclean mostlyclean-generic \ + mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ + uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. Modified: trunk/launchd/aclocal.m4 =================================================================== --- trunk/launchd/aclocal.m4 2006-09-06 23:18:08 UTC (rev 22843) +++ trunk/launchd/aclocal.m4 2006-09-07 19:52:41 UTC (rev 22844) @@ -1,7 +1,7 @@ -# aclocal.m4t generated automatically by aclocal 1.6.3 -*- Autoconf -*- +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,308 +11,33 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. -# Do all the work for Automake. -*- Autoconf -*- +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This macro actually does too much some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 8 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -AC_PREREQ([2.52]) - -# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow -# the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl - AC_REQUIRE([AC_PROG_INSTALL])dnl -# test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && - test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) -fi - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl - AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl - AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AM_MISSING_PROG(AMTAR, tar) -AM_PROG_INSTALL_SH -AM_PROG_INSTALL_STRIP -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl - -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_][CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_][CC], - defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_][CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_][CXX], - defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl -]) -]) - -# Copyright 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. -AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.6.3])]) + [AM_AUTOMAKE_VERSION([1.9.6])]) -# Helper functions for option handling. -*- Autoconf -*- +# AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright 2001, 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 2 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# ------------------------------ -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ---------------------------------- -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # -# Check to make sure that the build environment is sane. -# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t $srcdir/configure conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# -*- Autoconf -*- - - -# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# serial 3 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# AM_AUX_DIR_EXPAND - -# Copyright 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. @@ -351,99 +76,56 @@ # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. -# Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50]) - -AC_DEFUN([AM_AUX_DIR_EXPAND], [ +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. +# AM_CONDITIONAL -*- Autoconf -*- -# Copyright 2001 Free Software Foundation, Inc. +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 7 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -install_sh=${install_sh-"$am_aux_dir/install-sh"} -AC_SUBST(install_sh)]) - -# AM_PROG_INSTALL_STRIP - -# Copyright 2001 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= fi -INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) -# serial 4 -*- Autoconf -*- -# Copyright 1999, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 8 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - - # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's @@ -451,7 +133,6 @@ # CC etc. in the Makefile, will ask for an AC_PROG_CC use... - # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. @@ -487,18 +168,34 @@ # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. - echo '#include "conftest.h"' > conftest.c - echo 'int i;' > conftest.h - echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) @@ -516,13 +213,25 @@ # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=conftest.c object=conftest.o \ - depfile=conftest.Po tmpdepfile=conftest.TPo \ - $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && - grep conftest.h conftest.Po > /dev/null 2>&1 && + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - am_cv_$1_dependencies_compiler_type=$depmode - break + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi fi done @@ -533,6 +242,9 @@ fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) @@ -541,16 +253,8 @@ # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], -[rm -f .deps 2>/dev/null -mkdir .deps 2>/dev/null -if test -d .deps; then - DEPDIR=.deps -else - # MS-DOS does not allow filenames that begin with a dot. - DEPDIR=_deps -fi -rmdir .deps 2>/dev/null -AC_SUBST([DEPDIR]) +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) @@ -558,8 +262,8 @@ # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors]) +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -568,27 +272,17 @@ AC_SUBST([AMDEPBACKSLASH]) ]) -# Generate code to set up dependency tracking. -*- Autoconf -*- +# Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +#serial 3 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. - -#serial 2 - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -606,27 +300,21 @@ else continue fi - grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue @@ -652,33 +340,186 @@ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) -# Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 8 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# Do all the work for Automake. -*- Autoconf -*- +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + # serial 2 +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' -doit: +am__doit: @echo done +.PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) @@ -692,7 +533,7 @@ # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU @@ -706,131 +547,316 @@ _am_result=BSD fi fi -AC_SUBST(am__include) -AC_SUBST(am__quote) -AC_MSG_RESULT($_am_result) +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) -# AM_CONDITIONAL -*- Autoconf -*- +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 4 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. -# serial 5 +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) -AC_PREREQ(2.52) +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE]) -AC_SUBST([$1_FALSE]) -if $2; then - $1_TRUE= - $1_FALSE='#' +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' else - $1_TRUE='#' - $1_FALSE= + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([conditional \"$1\" was never defined. -Usually this means the macro was only invoked conditionally.]) -fi])]) +AC_SUBST([mkdir_p])]) -# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- +# Helper functions for option handling. -*- Autoconf -*- -# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. +# serial 3 -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA. +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) -AC_PREREQ([2.52]) +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) -# serial 6 +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. We must strip everything past the first ":", -# and everything past the last "/". +# Check to make sure that the build environment is sane. -*- Autoconf -*- -# _AM_DIRNAME(PATH) -# ----------------- -# Like AS_DIRNAME, only do it during macro expansion -AC_DEFUN([_AM_DIRNAME], - [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, - m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, - m4_if(regexp([$1], [^/.*]), -1, - [.], - patsubst([$1], [^\(/\).*], [\1])), - patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), - patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl -])# _AM_DIRNAME +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 4 -# The stamp files are numbered to have different names. -# We could number them on a directory basis, but that's additional -# complications, let's have a unique counter. -m4_define([_AM_STAMP_Count], [0]) +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi -# _AM_STAMP(HEADER) -# ----------------- -# The name of the stamp file for HEADER. -AC_DEFUN([_AM_STAMP], -[m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl -AS_ESCAPE(_AM_DIRNAME(patsubst([$1], - [:.*])))/stamp-h[]_AM_STAMP_Count]) + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -# _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) -# ------------------------------------------------------------ -# We used to try to get a real timestamp in stamp-h. But the fear is that -# that will cause unnecessary cvs conflicts. -AC_DEFUN([_AM_CONFIG_HEADER], -[# Add the stamp file to the list of files AC keeps track of, -# along with our hook. -AC_CONFIG_HEADERS([$1], - [# update the timestamp -echo 'timestamp for $1' >"_AM_STAMP([$1])" -$2], - [$3]) -])# _AM_CONFIG_HEADER +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +# Check how to create a tarball. -*- Autoconf -*- -# AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) -# -------------------------------------------------------------- -AC_DEFUN([AM_CONFIG_HEADER], -[AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) -])# AM_CONFIG_HEADER +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + Modified: trunk/launchd/configure =================================================================== --- trunk/launchd/configure 2006-09-06 23:18:08 UTC (rev 22843) +++ trunk/launchd/configure 2006-09-07 19:52:41 UTC (rev 22844) @@ -1,10 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for launchd 1.0. +# Generated by GNU Autoconf 2.60 for launchd 1.0. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,11 +19,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -31,8 +56,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -46,18 +106,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -65,157 +126,386 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +514,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,39 +535,27 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 - # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='launchd' PACKAGE_TARNAME='launchd' @@ -302,18 +592,108 @@ #endif #if HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif +#if HAVE_STDINT_H +# include +#endif #if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE RANLIB ac_ct_RANLIB CPP EGREP ALLOCA LIBOBJS LIBS_ONLY_TRUE LIBS_ONLY_FALSE LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +RANLIB +CPP +GREP +EGREP +ALLOCA +LIBOBJS +LIBS_ONLY_TRUE +LIBS_ONLY_FALSE +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= ac_init_version=false @@ -339,34 +719,48 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,12 +782,18 @@ --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -401,8 +801,18 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. @@ -410,11 +820,7 @@ { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +847,12 @@ -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -465,13 +877,16 @@ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,6 +951,16 @@ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -592,11 +1017,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -605,7 +1026,7 @@ { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -636,8 +1057,7 @@ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -657,29 +1077,21 @@ { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. @@ -704,74 +1116,76 @@ test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } - fi + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -800,9 +1214,6 @@ -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -820,15 +1231,22 @@ --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/launchd] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -849,16 +1267,16 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking Speeds up one-time builds - --enable-dependency-tracking Do not reject slow dependency extractors + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -866,120 +1284,86 @@ Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF launchd configure 1.0 -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.60 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by launchd $as_me 1.0, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -998,7 +1382,7 @@ /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1012,6 +1396,7 @@ test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1033,7 +1418,6 @@ ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1044,7 +1428,7 @@ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1066,9 +1450,7 @@ -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1079,8 +1461,8 @@ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1093,20 +1475,34 @@ _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1117,22 +1513,28 @@ echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1144,26 +1546,24 @@ ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1194,14 +1594,17 @@ # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1217,8 +1620,8 @@ { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1230,12 +1633,11 @@ # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1260,8 +1662,7 @@ # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1278,11 +1679,6 @@ { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu @@ -1307,36 +1703,46 @@ +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - -am__api_version="1.6" +am__api_version="1.9" ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -1350,8 +1756,8 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1373,7 +1779,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1392,21 +1798,22 @@ ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1416,8 +1823,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo "$as_me:$LINENO: checking whether build environment is sane" >&5 -echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } # Just in case sleep 1 echo timestamp > conftest.file @@ -1459,22 +1866,21 @@ Check your system clock" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed - # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` @@ -1488,12 +1894,45 @@ echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1506,58 +1945,70 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi - # test to see if srcdir already configured +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 @@ -1565,9 +2016,19 @@ { (exit 1); exit 1; }; } fi +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + # Define the identity of the package. - PACKAGE=launchd - VERSION=1.0 + PACKAGE='launchd' + VERSION='1.0' cat >>confdefs.h <<_ACEOF @@ -1595,9 +2056,6 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -AMTAR=${AMTAR-"${am_missing_run}tar"} - install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user @@ -1608,8 +2066,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1622,32 +2080,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1660,27 +2120,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -1690,16 +2164,19 @@ # We need awk for the "check" target. The system "awk" is bad on # some platforms. +# Always define AMTAR for backward compatibility. +AMTAR=${AMTAR-"${am_missing_run}tar"} +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' -# Add the stamp file to the list of files AC keeps track of, -# along with our hook. - ac_config_headers="$ac_config_headers src/config.h" +ac_config_headers="$ac_config_headers src/config.h" + + # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1709,8 +2186,8 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1723,32 +2200,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1761,36 +2240,51 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1803,74 +2297,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + fi -done -done - fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - -fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1884,7 +2338,7 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1895,6 +2349,7 @@ fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1912,22 +2367,23 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1940,36 +2396,38 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1982,29 +2440,45 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2017,21 +2491,35 @@ { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2056,46 +2544,70 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - conftest.$ac_ext ) - # This is the source file. - ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2108,19 +2620,23 @@ fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2139,22 +2655,27 @@ fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2165,9 +2686,8 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2181,14 +2701,14 @@ fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2208,14 +2728,20 @@ } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2233,12 +2759,12 @@ rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2261,24 +2787,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2287,24 +2825,28 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2320,24 +2862,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2346,12 +2900,131 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2367,12 +3040,12 @@ CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2406,12 +3079,17 @@ /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2426,232 +3104,93 @@ return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -rm -f .deps 2>/dev/null -mkdir .deps 2>/dev/null -if test -d .deps; then - DEPDIR=.deps -else - # MS-DOS does not allow filenames that begin with a dot. - DEPDIR=_deps -fi -rmdir .deps 2>/dev/null +DEPDIR="${am__leading_dot}deps" +ac_config_commands="$ac_config_commands depfiles" - ac_config_commands="$ac_config_commands depfiles" - am_make=${MAKE-make} cat > confinc << 'END' -doit: +am__doit: @echo done +.PHONY: am__doit END # If we don't find an include directive, just comment out the code. -echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 -echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } am__include="#" am__quote= _am_result=none @@ -2662,7 +3201,7 @@ # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. -if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU @@ -2678,15 +3217,15 @@ fi -echo "$as_me:$LINENO: result: $_am_result" >&5 -echo "${ECHO_T}$_am_result" >&6 +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } rm -f confinc confmf -# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +# Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then - enableval="$enable_dependency_tracking" + enableval=$enable_dependency_tracking; +fi -fi; if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -2706,8 +3245,8 @@ depcc="$CC" am_compiler_list= -echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 -echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2722,18 +3261,34 @@ # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. - echo '#include "conftest.h"' > conftest.c - echo 'int i;' > conftest.h - echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) @@ -2751,13 +3306,25 @@ # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ - source=conftest.c object=conftest.o \ - depfile=conftest.Po tmpdepfile=conftest.TPo \ - $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && - grep conftest.h conftest.Po > /dev/null 2>&1 && + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - am_cv_CC_dependencies_compiler_type=$depmode - break + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi fi done @@ -2768,16 +3335,28 @@ fi fi -echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 -echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2790,32 +3369,34 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6 + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2828,27 +3409,41 @@ IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - RANLIB=$ac_ct_RANLIB + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else RANLIB="$ac_cv_prog_RANLIB" fi @@ -2864,9 +3459,9 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -2888,24 +3483,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2914,12 +3521,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 @@ -2931,13 +3540,12 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2945,126 +3553,99 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in dir; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_search_opendir=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else - echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS -ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3072,115 +3653,89 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char opendir (); int main () { -opendir (); +return opendir (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_search_opendir="none required" + ac_cv_search_opendir=$ac_res else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -if test "$ac_cv_search_opendir" = no; then - for ac_lib in x; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir (); -int -main () -{ -opendir (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_search_opendir="-l$ac_lib" -break +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then + : else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_search_opendir=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done -fi +rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6 -if test "$ac_cv_search_opendir" != no; then - test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi @@ -3191,8 +3746,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3226,8 +3781,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3252,9 +3812,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3264,8 +3825,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3292,6 +3858,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3309,8 +3876,8 @@ else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3333,8 +3900,13 @@ #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3359,9 +3931,10 @@ # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3371,8 +3944,13 @@ /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3399,6 +3977,7 @@ ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3421,23 +4000,170 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3461,24 +4187,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3487,10 +4225,11 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF @@ -3545,6 +4284,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3564,18 +4304,27 @@ for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3588,12 +4337,14 @@ ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3602,8 +4353,8 @@ fi -echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 -echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; } if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3616,7 +4367,7 @@ #include #include #ifndef WEXITSTATUS -# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) @@ -3633,24 +4384,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3659,12 +4422,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_sys_wait_h=no + ac_cv_header_sys_wait_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -3687,9 +4451,9 @@ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3703,24 +4467,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3729,12 +4505,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3765,18 +4543,19 @@ for ac_header in fcntl.h limits.h mach/mach.h netdb.h netinet/in.h paths.h stddef.h stdlib.h string.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3787,24 +4566,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3813,15 +4604,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3830,8 +4622,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3855,9 +4652,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -3881,25 +4679,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -3913,8 +4710,8 @@ # Checks for typedefs, structures, and compiler characteristics. -echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 -echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 +echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3927,22 +4724,22 @@ #include #ifndef bool -# error bool is not defined + "error: bool is not defined" #endif #ifndef false -# error false is not defined + "error: false is not defined" #endif #if false -# error false is not 0 + "error: false is not 0" #endif #ifndef true -# error true is not defined + "error: true is not defined" #endif #if true != 1 -# error true is not 1 + "error: true is not 1" #endif #ifndef __bool_true_false_are_defined -# error __bool_true_false_are_defined is not defined + "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; @@ -3950,40 +4747,87 @@ char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) -0.5 == true ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; - char f[(_Bool) -0.0 == false ? 1 : -1]; + char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + _Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; +# if defined __xlc__ || defined __GNUC__ + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 + reported by James Lemley on 2005-10-05; see + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html + This test is not quite right, since xlc is allowed to + reject this program, as the initializer for xlcbug is + not one of the forms that C requires support for. + However, doing the test right would require a runtime + test, and that would make cross-compilation harder. + Let us hope that IBM fixes the xlc bug, and also adds + support for this kind of constant expression. In the + meantime, this test will reject xlc, which is OK, since + our stdbool.h substitute should suffice. We also test + this with GCC, where it should work, to detect more + quickly whether someone messes up the test in the + future. */ + char digs[] = "0123456789"; + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); +# endif + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + _Bool q = true; + _Bool *pq = &q; int main () { - return !a + !b + !c + !d + !e + !f + !g + !h + !i; + + *pq |= q; + *pq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3992,14 +4836,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdbool_h=no + ac_cv_header_stdbool_h=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 -echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6 -echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 +echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4010,36 +4855,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef _Bool ac__type_new_; int main () { -if ((_Bool *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (_Bool)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4048,12 +4906,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type__Bool=no + ac_cv_type__Bool=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF @@ -4071,8 +4930,8 @@ fi -echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4112,6 +4971,7 @@ char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; + if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; @@ -4130,7 +4990,9 @@ } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; + if (!foo) return 0; } + return !x[0] && !zero.x; #endif ; @@ -4138,24 +5000,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4164,12 +5038,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_const=no + ac_cv_c_const=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF @@ -4178,8 +5053,8 @@ fi -echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4201,8 +5076,8 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -4216,8 +5091,8 @@ fi -echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4228,36 +5103,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef mode_t ac__type_new_; int main () { -if ((mode_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (mode_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4266,12 +5154,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_mode_t=no + ac_cv_type_mode_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else @@ -4282,8 +5171,8 @@ fi -echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4294,36 +5183,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if ((off_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (off_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4332,24 +5234,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_off_t=no + ac_cv_type_off_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define off_t long +#define off_t long int _ACEOF fi -echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4360,36 +5263,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef pid_t ac__type_new_; int main () { -if ((pid_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (pid_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4398,12 +5314,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_pid_t=no + ac_cv_type_pid_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else @@ -4414,8 +5331,8 @@ fi -echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4426,36 +5343,49 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if ((size_t *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (size_t)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4464,24 +5394,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_size_t=no + ac_cv_type_size_t=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF -#define size_t unsigned +#define size_t unsigned int _ACEOF fi -echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4505,24 +5436,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4531,12 +5474,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_time=no + ac_cv_header_time=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -4545,8 +5489,8 @@ fi -echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4568,24 +5512,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4594,12 +5550,13 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_struct_tm=sys/time.h + ac_cv_struct_tm=sys/time.h fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -4612,8 +5569,8 @@ # Checks for library functions. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -echo "$as_me:$LINENO: checking for working alloca.h" >&5 -echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; } if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4628,29 +5585,42 @@ main () { char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4659,13 +5629,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_working_alloca_h=no + ac_cv_working_alloca_h=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 -echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -4674,8 +5645,8 @@ fi -echo "$as_me:$LINENO: checking for alloca" >&5 -echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; } if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4710,29 +5681,42 @@ main () { char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4741,13 +5725,14 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_alloca_works=no + ac_cv_func_alloca_works=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 -echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; } if test $ac_cv_func_alloca_works = yes; then @@ -4761,15 +5746,15 @@ # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. -ALLOCA=alloca.$ac_objext +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF -echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 -echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; } if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4779,7 +5764,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#if defined(CRAY) && ! defined(CRAY2) +#if defined CRAY && ! defined CRAY2 webecray #else wenotbecray @@ -4795,14 +5780,14 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 -echo "${ECHO_T}$ac_cv_os_cray" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&6; } if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4828,53 +5813,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; #endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4883,13 +5874,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @@ -4902,8 +5895,8 @@ done fi -echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 -echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; } if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4916,6 +5909,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int find_stack_direction () { @@ -4933,17 +5927,26 @@ int main () { - exit (find_stack_direction () < 0); + return find_stack_direction () < 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4956,11 +5959,13 @@ ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 -echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; } cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction @@ -4969,8 +5974,8 @@ fi -echo "$as_me:$LINENO: checking whether closedir returns void" >&5 -echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } if test "${ac_cv_func_closedir_void+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4992,19 +5997,28 @@ int main () { -exit (closedir (opendir (".")) != 0); +return closedir (opendir (".")) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5017,11 +6031,13 @@ ( exit $ac_status ) ac_cv_func_closedir_void=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 -echo "${ECHO_T}$ac_cv_func_closedir_void" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then cat >>confdefs.h <<\_ACEOF @@ -5031,22 +6047,22 @@ fi - -for ac_header in unistd.h vfork.h +for ac_header in vfork.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5057,24 +6073,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5083,15 +6111,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5100,8 +6129,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5125,9 +6159,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5151,25 +6186,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5186,9 +6220,9 @@ for ac_func in fork vfork do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5214,53 +6248,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; #endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5269,13 +6309,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5285,8 +6327,8 @@ done if test "x$ac_cv_func_fork" = xyes; then - echo "$as_me:$LINENO: checking for working fork" >&5 -echo $ECHO_N "checking for working fork... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for working fork" >&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6; } if test "${ac_cv_func_fork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5294,27 +6336,40 @@ ac_cv_func_fork_works=cross else cat >conftest.$ac_ext <<_ACEOF -/* By Ruediger Kuhlmann. */ - #include - #if HAVE_UNISTD_H - # include - #endif - /* Some systems only have a dummy stub for fork() */ - int main () - { - if (fork() < 0) - exit (1); - exit (0); - } +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* By Ruediger Kuhlmann. */ + return fork () < 0; + + ; + return 0; +} +_ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5327,11 +6382,13 @@ ( exit $ac_status ) ac_cv_func_fork_works=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 -echo "${ECHO_T}$ac_cv_func_fork_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork @@ -5351,8 +6408,8 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then - echo "$as_me:$LINENO: checking for working vfork" >&5 -echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; } if test "${ac_cv_func_vfork_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5366,14 +6423,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ -#include -#include -#include -#include +$ac_includes_default #include -#if HAVE_UNISTD_H -# include -#endif #if HAVE_VFORK_H # include #endif @@ -5445,7 +6496,7 @@ while (wait(&status) != child) ; - exit( + return ( /* Was there some problem with vforking? */ child < 0 @@ -5462,13 +6513,22 @@ } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5481,11 +6541,13 @@ ( exit $ac_status ) ac_cv_func_vfork_works=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 -echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then @@ -5516,8 +6578,8 @@ fi if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 -echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; } if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5558,15 +6620,15 @@ fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 -echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 -echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5590,19 +6652,28 @@ /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ - exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); + return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5615,8 +6686,10 @@ ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + else # If the `ln -s' command failed, then we probably don't even # have an lstat function. @@ -5625,8 +6698,8 @@ rm -f conftest.sym conftest.file fi -echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && @@ -5636,18 +6709,16 @@ if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - case $LIBOBJS in - "lstat.$ac_objext" | \ - *" lstat.$ac_objext" | \ - "lstat.$ac_objext "* | \ + case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; esac fi -echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5 -echo $ECHO_N "checking whether lstat accepts an empty string... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether lstat accepts an empty string" >&5 +echo $ECHO_N "checking whether lstat accepts an empty string... $ECHO_C" >&6; } if test "${ac_cv_func_lstat_empty_string_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5665,43 +6736,52 @@ main () { struct stat sbuf; - exit (lstat ("", &sbuf) ? 1 : 0); + return lstat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_lstat_empty_string_bug=yes + ac_cv_func_lstat_empty_string_bug=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_func_lstat_empty_string_bug=no +ac_cv_func_lstat_empty_string_bug=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5 -echo "${ECHO_T}$ac_cv_func_lstat_empty_string_bug" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_empty_string_bug" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_empty_string_bug" >&6; } if test $ac_cv_func_lstat_empty_string_bug = yes; then - case $LIBOBJS in - "lstat.$ac_objext" | \ - *" lstat.$ac_objext" | \ - "lstat.$ac_objext "* | \ + case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; esac @@ -5711,8 +6791,8 @@ fi -echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 -echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether lstat dereferences a symlink specified with a trailing slash" >&5 +echo $ECHO_N "checking whether lstat dereferences a symlink specified with a trailing slash... $ECHO_C" >&6; } if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5736,19 +6816,28 @@ /* Linux will dereference the symlink and fail. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ - exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1); + return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5761,8 +6850,10 @@ ( exit $ac_status ) ac_cv_func_lstat_dereferences_slashed_symlink=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + else # If the `ln -s' command failed, then we probably don't even # have an lstat function. @@ -5771,8 +6862,8 @@ rm -f conftest.sym conftest.file fi -echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 -echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 +echo "${ECHO_T}$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && @@ -5782,12 +6873,10 @@ if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then - case $LIBOBJS in - "lstat.$ac_objext" | \ - *" lstat.$ac_objext" | \ - "lstat.$ac_objext "* | \ + case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS lstat.$ac_objext" + ;; esac fi @@ -5796,18 +6885,19 @@ for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5818,24 +6908,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5844,15 +6946,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5861,8 +6964,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -5886,9 +6994,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5912,25 +7021,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5942,8 +7050,8 @@ done -echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 -echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5965,19 +7073,28 @@ int main () { -exit (malloc (0) ? 0 : 1); +return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5990,11 +7107,13 @@ ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF @@ -6006,12 +7125,10 @@ #define HAVE_MALLOC 0 _ACEOF - case $LIBOBJS in - "malloc.$ac_objext" | \ - *" malloc.$ac_objext" | \ - "malloc.$ac_objext "* | \ + case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS malloc.$ac_objext" + ;; esac @@ -6029,18 +7146,19 @@ for ac_header in stdlib.h sys/time.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6051,24 +7169,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6077,15 +7207,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6094,8 +7225,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6119,9 +7255,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -6145,25 +7282,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -6179,9 +7315,9 @@ for ac_func in alarm do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6207,53 +7343,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; #endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6262,13 +7404,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -6277,8 +7421,8 @@ fi done -echo "$as_me:$LINENO: checking for working mktime" >&5 -echo $ECHO_N "checking for working mktime... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working mktime" >&5 +echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; } if test "${ac_cv_func_working_mktime+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6328,9 +7472,9 @@ }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) -/* Fail if mktime fails to convert a date in the spring-forward gap. +/* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ -static void +static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ @@ -6349,29 +7493,27 @@ tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; - if (mktime (&tm) == (time_t)-1) - exit (1); + return mktime (&tm) != (time_t) -1; } -static void +static int mktime_test1 (now) time_t now; { struct tm *lt; - if ((lt = localtime (&now)) && mktime (lt) != now) - exit (1); + return ! (lt = localtime (&now)) || mktime (lt) == now; } -static void +static int mktime_test (now) time_t now; { - mktime_test1 (now); - mktime_test1 ((time_t) (time_t_max - now)); - mktime_test1 ((time_t) (time_t_min + now)); + return (mktime_test1 (now) + && mktime_test1 ((time_t) (time_t_max - now)) + && mktime_test1 ((time_t) (time_t_min + now))); } -static void +static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ @@ -6384,11 +7526,10 @@ tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); - if (tm.tm_mon != 2 || tm.tm_mday != 31) - exit (1); + return tm.tm_mon == 2 && tm.tm_mday == 31; } -static void +static int bigtime_test (j) int j; { @@ -6410,8 +7551,9 @@ && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) - exit (1); + return 0; } + return 1; } int @@ -6438,28 +7580,39 @@ putenv (tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) - mktime_test (t); - mktime_test ((time_t) 1); - mktime_test ((time_t) (60 * 60)); - mktime_test ((time_t) (60 * 60 * 24)); + if (! mktime_test (t)) + return 1; + if (! (mktime_test ((time_t) 1) + && mktime_test ((time_t) (60 * 60)) + && mktime_test ((time_t) (60 * 60 * 24)))) + return 1; for (j = 1; 0 < j; j *= 2) - bigtime_test (j); - bigtime_test (j - 1); + if (! bigtime_test (j)) + return 1; + if (! bigtime_test (j - 1)) + return 1; } - irix_6_4_bug (); - spring_forward_gap (); - exit (0); + return ! (irix_6_4_bug () && spring_forward_gap ()); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6472,18 +7625,18 @@ ( exit $ac_status ) ac_cv_func_working_mktime=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 -echo "${ECHO_T}$ac_cv_func_working_mktime" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5 +echo "${ECHO_T}$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then - case $LIBOBJS in - "mktime.$ac_objext" | \ - *" mktime.$ac_objext" | \ - "mktime.$ac_objext "* | \ + case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS mktime.$ac_objext" + ;; esac fi @@ -6493,18 +7646,19 @@ for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6515,24 +7669,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6541,15 +7707,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6558,8 +7725,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -6583,9 +7755,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -6609,25 +7782,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -6643,9 +7815,9 @@ for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -6671,53 +7843,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; #endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6726,13 +7904,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -6741,8 +7921,8 @@ fi done -echo "$as_me:$LINENO: checking for working mmap" >&5 -echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6837,15 +8017,15 @@ /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) - exit (1); + return 1; if (write (fd, data, pagesize) != pagesize) - exit (1); + return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has @@ -6853,17 +8033,17 @@ we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) - exit (1); + return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) - exit (1); - data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + return 1; + data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) - exit (1); + return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on @@ -6872,24 +8052,33 @@ *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) - exit (1); + return 1; if (read (fd, data3, pagesize) != pagesize) - exit (1); + return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) - exit (1); + return 1; close (fd); - exit (0); + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6902,11 +8091,13 @@ ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 -echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF @@ -6920,18 +8111,19 @@ for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6942,24 +8134,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6968,15 +8172,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6985,8 +8190,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7010,9 +8220,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7036,25 +8247,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7066,8 +8276,8 @@ done -echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 -echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6; } if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7089,19 +8299,28 @@ int main () { -exit (realloc (0, 0) ? 0 : 1); +return ! realloc (0, 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7114,11 +8333,13 @@ ( exit $ac_status ) ac_cv_func_realloc_0_nonnull=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 -echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF @@ -7130,12 +8351,10 @@ #define HAVE_REALLOC 0 _ACEOF - case $LIBOBJS in - "realloc.$ac_objext" | \ - *" realloc.$ac_objext" | \ - "realloc.$ac_objext "* | \ + case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS realloc.$ac_objext" + ;; esac @@ -7152,18 +8371,19 @@ for ac_header in sys/select.h sys/socket.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7174,24 +8394,36 @@ #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7200,15 +8432,16 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7217,8 +8450,13 @@ /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -7242,9 +8480,10 @@ ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7268,25 +8507,24 @@ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to launchd-bug-reports@group.apple.com ## ## -------------------------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7298,13 +8536,13 @@ done -echo "$as_me:$LINENO: checking types of arguments for select" >&5 -echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking types of arguments for select" >&5 +echo $ECHO_N "checking types of arguments for select... $ECHO_C" >&6; } if test "${ac_cv_func_select_args+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do - for ac_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do + for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7331,24 +8569,36 @@ } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7357,8 +8607,10 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done @@ -7366,8 +8618,8 @@ : ${ac_cv_func_select_args='int,int *,struct timeval *'} fi -echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 -echo "${ECHO_T}$ac_cv_func_select_args" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_select_args" >&5 +echo "${ECHO_T}$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS @@ -7389,8 +8641,8 @@ rm -f conftest* -echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7402,64 +8654,69 @@ /* end confdefs.h. */ #include #include -#ifdef signal -# undef signal -#endif -#ifdef __cplusplus -extern "C" void (*signal (int, void (*)(int)))(int); -#else -void (*signal ()) (); -#endif int main () { -int i; +return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_type_signal=void + ac_cv_type_signal=int else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_signal=int + ac_cv_type_signal=void fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 -echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether stat accepts an empty string" >&5 +echo $ECHO_N "checking whether stat accepts an empty string... $ECHO_C" >&6; } if test "${ac_cv_func_stat_empty_string_bug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7477,43 +8734,52 @@ main () { struct stat sbuf; - exit (stat ("", &sbuf) ? 1 : 0); + return stat ("", &sbuf) == 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_func_stat_empty_string_bug=yes + ac_cv_func_stat_empty_string_bug=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -ac_cv_func_stat_empty_string_bug=no +ac_cv_func_stat_empty_string_bug=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 -echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5 +echo "${ECHO_T}$ac_cv_func_stat_empty_string_bug" >&6; } if test $ac_cv_func_stat_empty_string_bug = yes; then - case $LIBOBJS in - "stat.$ac_objext" | \ - *" stat.$ac_objext" | \ - "stat.$ac_objext "* | \ + case " $LIBOBJS " in *" stat.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS stat.$ac_objext" ;; + *) LIBOBJS="$LIBOBJS stat.$ac_objext" + ;; esac @@ -7545,9 +8811,9 @@ for ac_func in atexit dup2 gethostname gettimeofday memmove memset mkdir munmap rmdir select setenv socket strcasecmp strchr strdup strerror strrchr strstr strtol do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -7573,53 +8839,59 @@ #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; #endif -#ifdef __cplusplus -} -#endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7628,13 +8900,15 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -7644,7 +8918,7 @@ done - ac_config_files="$ac_config_files Makefile src/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile" @@ -7676,39 +8950,58 @@ # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7717,32 +9010,18 @@ # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -7756,6 +9035,13 @@ Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi if test -z "${LIBS_ONLY_TRUE}" && test -z "${LIBS_ONLY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LIBS_ONLY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -7794,11 +9080,35 @@ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi +BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset @@ -7807,8 +9117,43 @@ fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -7822,18 +9167,19 @@ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -7841,159 +9187,120 @@ # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -8002,7 +9309,19 @@ as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -8011,31 +9330,14 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by launchd $as_me 1.0, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.60. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8043,30 +9345,20 @@ CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +_ACEOF -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi - cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -8093,19 +9385,21 @@ $config_commands Report bugs to ." + _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ launchd config.status 1.0 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8116,39 +9410,24 @@ do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8158,18 +9437,24 @@ $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -8185,38 +9470,50 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF # -# INIT-COMMANDS section. +# INIT-COMMANDS # - AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + case $ac_config_target in + "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8228,696 +9525,571 @@ fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@PACKAGE@,$PACKAGE,;t t -s,@VERSION@,$VERSION,;t t -s,@ACLOCAL@,$ACLOCAL,;t t -s,@AUTOCONF@,$AUTOCONF,;t t -s,@AUTOMAKE@,$AUTOMAKE,;t t -s,@AUTOHEADER@,$AUTOHEADER,;t t -s,@MAKEINFO@,$MAKEINFO,;t t -s,@AMTAR@,$AMTAR,;t t -s,@install_sh@,$install_sh,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@DEPDIR@,$DEPDIR,;t t -s,@am__include@,$am__include,;t t -s,@am__quote@,$am__quote,;t t -s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t -s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t -s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t -s,@CCDEPMODE@,$CCDEPMODE,;t t -s,@RANLIB@,$RANLIB,;t t -s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@ALLOCA@,$ALLOCA,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LIBS_ONLY_TRUE@,$LIBS_ONLY_TRUE,;t t -s,@LIBS_ONLY_FALSE@,$LIBS_ONLY_FALSE,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +RANLIB!$RANLIB$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ALLOCA!$ALLOCA$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LIBS_ONLY_TRUE!$LIBS_ONLY_TRUE$ac_delim +LIBS_ONLY_FALSE!$LIBS_ONLY_FALSE$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' -ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' - -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + rm -f "$tmp/stdin" case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS +rm -f conftest.defines conftest.tail -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs - +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi - # Run the commands associated with the file. - case $ac_file in - src/config.h ) # update the timestamp -echo 'timestamp for src/config.h' >"src/stamp-h1" - ;; + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| . 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; -# -# CONFIG_COMMANDS section. -# -for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac - ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 -echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. @@ -8927,92 +10099,123 @@ # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then - dirpart=`(dirname "$mf") 2>/dev/null || + dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$mf" : 'X\(/\)' \| . 2>/dev/null || echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` else continue fi - grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue - # Extract the definition of DEP_FILES from the Makefile without - # running `make'. - DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n -e '/^U = / s///p' < "$mf"` - test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" - # We invoke sed twice because it is the simplest approach to - # changing $(DEPDIR) to its actual value in the expansion. - for file in `sed -n -e ' - /^DEP_FILES = .*\\\\$/ { - s/^DEP_FILES = // - :loop - s/\\\\$// - p - n - /\\\\$/ b loop - p - } - /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue - fdir=`(dirname "$file") 2>/dev/null || + fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$file" : 'X\(/\)' \| . 2>/dev/null || echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p $dirpart/$fdir - else - as_dir=$dirpart/$fdir + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 -echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; + esac -done -_ACEOF +done # for ac_tag -cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-06 23:18:08 UTC (rev 22843) +++ trunk/launchd/src/Makefile.in 2006-09-07 19:52:41 UTC (rev 22844) @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.6.3 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,143 +13,82 @@ # PARTICULAR PURPOSE. @SET_MAKE@ -SHELL = @SHELL@ + + + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c -INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) -transform = @program_transform_name@ +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : - -EXEEXT = @EXEEXT@ -OBJEXT = @OBJEXT@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -AMTAR = @AMTAR@ -AWK = @AWK@ -CC = @CC@ -DEPDIR = @DEPDIR@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -PACKAGE = @PACKAGE@ -RANLIB = @RANLIB@ -STRIP = @STRIP@ -VERSION = @VERSION@ -am__include = @am__include@ -am__quote = @am__quote@ -install_sh = @install_sh@ -AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 - -CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h - -@LIBS_ONLY_TRUE@noinst_LIBRARIES = liblaunch.a liblaunch_profile.a - -@LIBS_ONLY_TRUE@liblaunch_a_SOURCES = liblaunch.c bootstrap_public.c - -@LIBS_ONLY_TRUE@liblaunch_profile_a_CFLAGS = -pg $(AM_CFLAGS) -@LIBS_ONLY_TRUE@liblaunch_profile_a_SOURCES = liblaunch.c bootstrap_public.c - -@LIBS_ONLY_FALSE@sbin_SCRIPTS = service - -@LIBS_ONLY_FALSE@bin_PROGRAMS = launchctl wait4path -@LIBS_ONLY_FALSE@sbin_PROGRAMS = launchd SystemStarter -@LIBS_ONLY_FALSE@libexec_PROGRAMS = launchproxy - -@LIBS_ONLY_FALSE@sysconf_DATA = hostconfig rc.common rc.netboot rc.shutdown - -@LIBS_ONLY_FALSE@launchctl_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden -@LIBS_ONLY_FALSE@launchctl_LDFLAGS = -framework CoreFoundation -weak_library /usr/lib/libedit.dylib - -@LIBS_ONLY_FALSE@SystemStarter_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -fvisibility=hidden -@LIBS_ONLY_FALSE@SystemStarter_LDFLAGS = -framework CoreFoundation -@LIBS_ONLY_FALSE@SystemStarter_SOURCES = StartupItems.c IPC.c SystemStarter.c - -@LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden -@LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm -@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c - -@LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security - -@LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 - -@LIBS_ONLY_FALSE@man5_MANS = launchd.plist.5 launchd.conf.5 - -@LIBS_ONLY_FALSE@man8_MANS = StartupItemContext.8 SystemStarter.8 rc.8 launchd.8 service.8 launchproxy.8 - -@LIBS_ONLY_FALSE@STARTUPITEMS = $(basename $(notdir $(wildcard $(srcdir)/StartupItems/*.plist))) +@LIBS_ONLY_FALSE@bin_PROGRAMS = launchctl$(EXEEXT) wait4path$(EXEEXT) +@LIBS_ONLY_FALSE@sbin_PROGRAMS = launchd$(EXEEXT) \ +@LIBS_ONLY_FALSE@ SystemStarter$(EXEEXT) +@LIBS_ONLY_FALSE@libexec_PROGRAMS = launchproxy$(EXEEXT) subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) - -liblaunch_a_AR = $(AR) cru +AR = ar +ARFLAGS = cru +liblaunch_a_AR = $(AR) $(ARFLAGS) liblaunch_a_LIBADD = +am__liblaunch_a_SOURCES_DIST = liblaunch.c bootstrap_public.c @LIBS_ONLY_TRUE@am_liblaunch_a_OBJECTS = liblaunch.$(OBJEXT) \ @LIBS_ONLY_TRUE@ bootstrap_public.$(OBJEXT) liblaunch_a_OBJECTS = $(am_liblaunch_a_OBJECTS) -liblaunch_profile_a_AR = $(AR) cru +liblaunch_profile_a_AR = $(AR) $(ARFLAGS) liblaunch_profile_a_LIBADD = -@LIBS_ONLY_TRUE@am_liblaunch_profile_a_OBJECTS = \ +am__liblaunch_profile_a_SOURCES_DIST = liblaunch.c bootstrap_public.c +@LIBS_ONLY_TRUE@am_liblaunch_profile_a_OBJECTS = \ @LIBS_ONLY_TRUE@ liblaunch_profile_a-liblaunch.$(OBJEXT) \ @LIBS_ONLY_TRUE@ liblaunch_profile_a-bootstrap_public.$(OBJEXT) liblaunch_profile_a_OBJECTS = $(am_liblaunch_profile_a_OBJECTS) -@LIBS_ONLY_TRUE@bin_PROGRAMS = -@LIBS_ONLY_FALSE@bin_PROGRAMS = launchctl$(EXEEXT) wait4path$(EXEEXT) -@LIBS_ONLY_TRUE@libexec_PROGRAMS = -@LIBS_ONLY_FALSE@libexec_PROGRAMS = launchproxy$(EXEEXT) -@LIBS_ONLY_TRUE@sbin_PROGRAMS = -@LIBS_ONLY_FALSE@sbin_PROGRAMS = launchd$(EXEEXT) SystemStarter$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" \ + "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(sysconfdir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(sbin_PROGRAMS) - -@LIBS_ONLY_FALSE@am_SystemStarter_OBJECTS = \ +am__SystemStarter_SOURCES_DIST = StartupItems.c IPC.c SystemStarter.c +@LIBS_ONLY_FALSE@am_SystemStarter_OBJECTS = \ @LIBS_ONLY_FALSE@ SystemStarter-StartupItems.$(OBJEXT) \ @LIBS_ONLY_FALSE@ SystemStarter-IPC.$(OBJEXT) \ @LIBS_ONLY_FALSE@ SystemStarter-SystemStarter.$(OBJEXT) SystemStarter_OBJECTS = $(am_SystemStarter_OBJECTS) SystemStarter_LDADD = $(LDADD) -SystemStarter_DEPENDENCIES = launchctl_SOURCES = launchctl.c launchctl_OBJECTS = launchctl-launchctl.$(OBJEXT) launchctl_LDADD = $(LDADD) -launchctl_DEPENDENCIES = +am__launchd_SOURCES_DIST = launchd.c launchd_core_logic.c \ + launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c \ + notifyServer.c launchd_internalUser.c launchd_internalServer.c \ + mpm_replyUser.c @LIBS_ONLY_FALSE@am_launchd_OBJECTS = launchd-launchd.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_core_logic.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_unix_ipc.$(OBJEXT) \ @@ -162,72 +101,182 @@ @LIBS_ONLY_FALSE@ launchd-mpm_replyUser.$(OBJEXT) launchd_OBJECTS = $(am_launchd_OBJECTS) launchd_LDADD = $(LDADD) -launchd_DEPENDENCIES = launchproxy_SOURCES = launchproxy.c launchproxy_OBJECTS = launchproxy.$(OBJEXT) launchproxy_LDADD = $(LDADD) -launchproxy_DEPENDENCIES = wait4path_SOURCES = wait4path.c wait4path_OBJECTS = wait4path.$(OBJEXT) wait4path_LDADD = $(LDADD) -wait4path_DEPENDENCIES = -wait4path_LDFLAGS = +sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sbin_SCRIPTS) - - -DEFS = @DEFS@ -DEFAULT_INCLUDES = -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles -@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/SystemStarter-IPC.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/SystemStarter-StartupItems.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/SystemStarter-SystemStarter.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/bootstrap_public.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchctl-launchctl.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-bootstrapServer.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-init.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd_core_logic.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd_internalServer.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd_internalUser.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd_mach_ipc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-launchd_unix_ipc.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-mpm_replyUser.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchd-notifyServer.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/launchproxy.Po ./$(DEPDIR)/liblaunch.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/liblaunch_profile_a-liblaunch.Po \ -@AMDEP_TRUE@ ./$(DEPDIR)/wait4path.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -CFLAGS = @CFLAGS@ -DIST_SOURCES = $(liblaunch_a_SOURCES) $(liblaunch_profile_a_SOURCES) \ +SOURCES = $(liblaunch_a_SOURCES) $(liblaunch_profile_a_SOURCES) \ $(SystemStarter_SOURCES) launchctl.c $(launchd_SOURCES) \ launchproxy.c wait4path.c - +DIST_SOURCES = $(am__liblaunch_a_SOURCES_DIST) \ + $(am__liblaunch_profile_a_SOURCES_DIST) \ + $(am__SystemStarter_SOURCES_DIST) launchctl.c \ + $(am__launchd_SOURCES_DIST) launchproxy.c wait4path.c +man1dir = $(mandir)/man1 +man5dir = $(mandir)/man5 +man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man1_MANS) $(man5_MANS) $(man8_MANS) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(sysconf_DATA) - -DIST_COMMON = Makefile.am Makefile.in config.h.in -SOURCES = $(liblaunch_a_SOURCES) $(liblaunch_profile_a_SOURCES) $(SystemStarter_SOURCES) launchctl.c $(launchd_SOURCES) launchproxy.c wait4path.c - +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBS_ONLY_FALSE = @LIBS_ONLY_FALSE@ +LIBS_ONLY_TRUE = @LIBS_ONLY_TRUE@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 +CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h +@LIBS_ONLY_TRUE@noinst_LIBRARIES = liblaunch.a liblaunch_profile.a +@LIBS_ONLY_TRUE@liblaunch_a_SOURCES = liblaunch.c bootstrap_public.c +@LIBS_ONLY_TRUE@liblaunch_profile_a_CFLAGS = -pg $(AM_CFLAGS) +@LIBS_ONLY_TRUE@liblaunch_profile_a_SOURCES = liblaunch.c bootstrap_public.c +@LIBS_ONLY_FALSE@sbin_SCRIPTS = service +@LIBS_ONLY_FALSE@sysconf_DATA = hostconfig rc.common rc.netboot rc.shutdown +@LIBS_ONLY_FALSE@launchctl_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden +@LIBS_ONLY_FALSE@launchctl_LDFLAGS = -framework CoreFoundation -weak_library /usr/lib/libedit.dylib +@LIBS_ONLY_FALSE@SystemStarter_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -fvisibility=hidden +@LIBS_ONLY_FALSE@SystemStarter_LDFLAGS = -framework CoreFoundation +@LIBS_ONLY_FALSE@SystemStarter_SOURCES = StartupItems.c IPC.c SystemStarter.c +@LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden +@LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm +@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c +@LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security +@LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 +@LIBS_ONLY_FALSE@man5_MANS = launchd.plist.5 launchd.conf.5 +@LIBS_ONLY_FALSE@man8_MANS = StartupItemContext.8 SystemStarter.8 rc.8 launchd.8 service.8 launchproxy.8 +@LIBS_ONLY_FALSE@STARTUPITEMS = $(basename $(notdir $(wildcard $(srcdir)/StartupItems/*.plist))) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ @@ -237,39 +286,34 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h - -$(srcdir)/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) +$(srcdir)/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) - touch $(srcdir)/config.h.in + rm -f stamp-h1 + touch $@ distclean-hdr: -rm -f config.h stamp-h1 -AR = ar - clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liblaunch.a: $(liblaunch_a_OBJECTS) $(liblaunch_a_DEPENDENCIES) -rm -f liblaunch.a $(liblaunch_a_AR) liblaunch.a $(liblaunch_a_OBJECTS) $(liblaunch_a_LIBADD) $(RANLIB) liblaunch.a -liblaunch_profile_a-liblaunch.$(OBJEXT): liblaunch.c -liblaunch_profile_a-bootstrap_public.$(OBJEXT): bootstrap_public.c liblaunch_profile.a: $(liblaunch_profile_a_OBJECTS) $(liblaunch_profile_a_DEPENDENCIES) -rm -f liblaunch_profile.a $(liblaunch_profile_a_AR) liblaunch_profile.a $(liblaunch_profile_a_OBJECTS) $(liblaunch_profile_a_LIBADD) $(RANLIB) liblaunch_profile.a -binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(bindir) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done @@ -277,23 +321,22 @@ @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ - rm -f $(DESTDIR)$(bindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(libexecdir) + test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)" @list='$(libexec_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(libexecdir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) $$p $(DESTDIR)$(libexecdir)/$$f; \ + echo " $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \ else :; fi; \ done @@ -301,23 +344,22 @@ @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ - rm -f $(DESTDIR)$(libexecdir)/$$f; \ + echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \ + rm -f "$(DESTDIR)$(libexecdir)/$$f"; \ done clean-libexecPROGRAMS: -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) -sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(sbindir) + test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ - $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \ + echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ else :; fi; \ done @@ -325,32 +367,18 @@ @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ - rm -f $(DESTDIR)$(sbindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) -SystemStarter-StartupItems.$(OBJEXT): StartupItems.c -SystemStarter-IPC.$(OBJEXT): IPC.c -SystemStarter-SystemStarter.$(OBJEXT): SystemStarter.c SystemStarter$(EXEEXT): $(SystemStarter_OBJECTS) $(SystemStarter_DEPENDENCIES) @rm -f SystemStarter$(EXEEXT) $(LINK) $(SystemStarter_LDFLAGS) $(SystemStarter_OBJECTS) $(SystemStarter_LDADD) $(LIBS) -launchctl-launchctl.$(OBJEXT): launchctl.c launchctl$(EXEEXT): $(launchctl_OBJECTS) $(launchctl_DEPENDENCIES) @rm -f launchctl$(EXEEXT) $(LINK) $(launchctl_LDFLAGS) $(launchctl_OBJECTS) $(launchctl_LDADD) $(LIBS) -launchd-launchd.$(OBJEXT): launchd.c -launchd-launchd_core_logic.$(OBJEXT): launchd_core_logic.c -launchd-launchd_unix_ipc.$(OBJEXT): launchd_unix_ipc.c -launchd-launchd_mach_ipc.$(OBJEXT): launchd_mach_ipc.c -launchd-init.$(OBJEXT): init.c -launchd-bootstrapServer.$(OBJEXT): bootstrapServer.c -launchd-notifyServer.$(OBJEXT): notifyServer.c -launchd-launchd_internalUser.$(OBJEXT): launchd_internalUser.c -launchd-launchd_internalServer.$(OBJEXT): launchd_internalServer.c -launchd-mpm_replyUser.$(OBJEXT): mpm_replyUser.c launchd$(EXEEXT): $(launchd_OBJECTS) $(launchd_DEPENDENCIES) @rm -f launchd$(EXEEXT) $(LINK) $(launchd_LDFLAGS) $(launchd_OBJECTS) $(launchd_LDADD) $(LIBS) @@ -360,16 +388,15 @@ wait4path$(EXEEXT): $(wait4path_OBJECTS) $(wait4path_DEPENDENCIES) @rm -f wait4path$(EXEEXT) $(LINK) $(wait4path_LDFLAGS) $(wait4path_OBJECTS) $(wait4path_LDADD) $(LIBS) -sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(sbindir) + test -z "$(sbindir)" || $(mkdir_p) "$(DESTDIR)$(sbindir)" @list='$(sbin_SCRIPTS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f $$d$$p; then \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " $(sbinSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(sbindir)/$$f"; \ - $(sbinSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(sbindir)/$$f; \ + echo " $(sbinSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ + $(sbinSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(sbindir)/$$f"; \ else :; fi; \ done @@ -377,12 +404,12 @@ @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; for p in $$list; do \ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ - echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ - rm -f $(DESTDIR)$(sbindir)/$$f; \ + echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \ + rm -f "$(DESTDIR)$(sbindir)/$$f"; \ done mostlyclean-compile: - -rm -f *.$(OBJEXT) core *.core + -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @@ -408,219 +435,247 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblaunch_profile_a-liblaunch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4path.Po@am__quote@ -distclean-depend: - -rm -rf ./$(DEPDIR) - .c.o: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: -@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(COMPILE) -c `cygpath -w $<` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` liblaunch_profile_a-liblaunch.o: liblaunch.c -@AMDEP_TRUE@ source='liblaunch.c' object='liblaunch_profile_a-liblaunch.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/liblaunch_profile_a-liblaunch.Po' tmpdepfile='$(DEPDIR)/liblaunch_profile_a-liblaunch.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-liblaunch.o `test -f 'liblaunch.c' || echo '$(srcdir)/'`liblaunch.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -MT liblaunch_profile_a-liblaunch.o -MD -MP -MF "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo" -c -o liblaunch_profile_a-liblaunch.o `test -f 'liblaunch.c' || echo '$(srcdir)/'`liblaunch.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo" "$(DEPDIR)/liblaunch_profile_a-liblaunch.Po"; else rm -f "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='liblaunch.c' object='liblaunch_profile_a-liblaunch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-liblaunch.o `test -f 'liblaunch.c' || echo '$(srcdir)/'`liblaunch.c liblaunch_profile_a-liblaunch.obj: liblaunch.c -@AMDEP_TRUE@ source='liblaunch.c' object='liblaunch_profile_a-liblaunch.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/liblaunch_profile_a-liblaunch.Po' tmpdepfile='$(DEPDIR)/liblaunch_profile_a-liblaunch.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-liblaunch.obj `cygpath -w liblaunch.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -MT liblaunch_profile_a-liblaunch.obj -MD -MP -MF "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo" -c -o liblaunch_profile_a-liblaunch.obj `if test -f 'liblaunch.c'; then $(CYGPATH_W) 'liblaunch.c'; else $(CYGPATH_W) '$(srcdir)/liblaunch.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo" "$(DEPDIR)/liblaunch_profile_a-liblaunch.Po"; else rm -f "$(DEPDIR)/liblaunch_profile_a-liblaunch.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='liblaunch.c' object='liblaunch_profile_a-liblaunch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-liblaunch.obj `if test -f 'liblaunch.c'; then $(CYGPATH_W) 'liblaunch.c'; else $(CYGPATH_W) '$(srcdir)/liblaunch.c'; fi` liblaunch_profile_a-bootstrap_public.o: bootstrap_public.c -@AMDEP_TRUE@ source='bootstrap_public.c' object='liblaunch_profile_a-bootstrap_public.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Po' tmpdepfile='$(DEPDIR)/liblaunch_profile_a-bootstrap_public.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-bootstrap_public.o `test -f 'bootstrap_public.c' || echo '$(srcdir)/'`bootstrap_public.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -MT liblaunch_profile_a-bootstrap_public.o -MD -MP -MF "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo" -c -o liblaunch_profile_a-bootstrap_public.o `test -f 'bootstrap_public.c' || echo '$(srcdir)/'`bootstrap_public.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo" "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Po"; else rm -f "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bootstrap_public.c' object='liblaunch_profile_a-bootstrap_public.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-bootstrap_public.o `test -f 'bootstrap_public.c' || echo '$(srcdir)/'`bootstrap_public.c liblaunch_profile_a-bootstrap_public.obj: bootstrap_public.c -@AMDEP_TRUE@ source='bootstrap_public.c' object='liblaunch_profile_a-bootstrap_public.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Po' tmpdepfile='$(DEPDIR)/liblaunch_profile_a-bootstrap_public.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-bootstrap_public.obj `cygpath -w bootstrap_public.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -MT liblaunch_profile_a-bootstrap_public.obj -MD -MP -MF "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo" -c -o liblaunch_profile_a-bootstrap_public.obj `if test -f 'bootstrap_public.c'; then $(CYGPATH_W) 'bootstrap_public.c'; else $(CYGPATH_W) '$(srcdir)/bootstrap_public.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo" "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Po"; else rm -f "$(DEPDIR)/liblaunch_profile_a-bootstrap_public.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bootstrap_public.c' object='liblaunch_profile_a-bootstrap_public.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblaunch_profile_a_CFLAGS) $(CFLAGS) -c -o liblaunch_profile_a-bootstrap_public.obj `if test -f 'bootstrap_public.c'; then $(CYGPATH_W) 'bootstrap_public.c'; else $(CYGPATH_W) '$(srcdir)/bootstrap_public.c'; fi` SystemStarter-StartupItems.o: StartupItems.c -@AMDEP_TRUE@ source='StartupItems.c' object='SystemStarter-StartupItems.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-StartupItems.Po' tmpdepfile='$(DEPDIR)/SystemStarter-StartupItems.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-StartupItems.o `test -f 'StartupItems.c' || echo '$(srcdir)/'`StartupItems.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-StartupItems.o -MD -MP -MF "$(DEPDIR)/SystemStarter-StartupItems.Tpo" -c -o SystemStarter-StartupItems.o `test -f 'StartupItems.c' || echo '$(srcdir)/'`StartupItems.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-StartupItems.Tpo" "$(DEPDIR)/SystemStarter-StartupItems.Po"; else rm -f "$(DEPDIR)/SystemStarter-StartupItems.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='StartupItems.c' object='SystemStarter-StartupItems.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-StartupItems.o `test -f 'StartupItems.c' || echo '$(srcdir)/'`StartupItems.c SystemStarter-StartupItems.obj: StartupItems.c -@AMDEP_TRUE@ source='StartupItems.c' object='SystemStarter-StartupItems.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-StartupItems.Po' tmpdepfile='$(DEPDIR)/SystemStarter-StartupItems.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-StartupItems.obj `cygpath -w StartupItems.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-StartupItems.obj -MD -MP -MF "$(DEPDIR)/SystemStarter-StartupItems.Tpo" -c -o SystemStarter-StartupItems.obj `if test -f 'StartupItems.c'; then $(CYGPATH_W) 'StartupItems.c'; else $(CYGPATH_W) '$(srcdir)/StartupItems.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-StartupItems.Tpo" "$(DEPDIR)/SystemStarter-StartupItems.Po"; else rm -f "$(DEPDIR)/SystemStarter-StartupItems.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='StartupItems.c' object='SystemStarter-StartupItems.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-StartupItems.obj `if test -f 'StartupItems.c'; then $(CYGPATH_W) 'StartupItems.c'; else $(CYGPATH_W) '$(srcdir)/StartupItems.c'; fi` SystemStarter-IPC.o: IPC.c -@AMDEP_TRUE@ source='IPC.c' object='SystemStarter-IPC.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-IPC.Po' tmpdepfile='$(DEPDIR)/SystemStarter-IPC.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-IPC.o `test -f 'IPC.c' || echo '$(srcdir)/'`IPC.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-IPC.o -MD -MP -MF "$(DEPDIR)/SystemStarter-IPC.Tpo" -c -o SystemStarter-IPC.o `test -f 'IPC.c' || echo '$(srcdir)/'`IPC.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-IPC.Tpo" "$(DEPDIR)/SystemStarter-IPC.Po"; else rm -f "$(DEPDIR)/SystemStarter-IPC.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IPC.c' object='SystemStarter-IPC.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-IPC.o `test -f 'IPC.c' || echo '$(srcdir)/'`IPC.c SystemStarter-IPC.obj: IPC.c -@AMDEP_TRUE@ source='IPC.c' object='SystemStarter-IPC.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-IPC.Po' tmpdepfile='$(DEPDIR)/SystemStarter-IPC.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-IPC.obj `cygpath -w IPC.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-IPC.obj -MD -MP -MF "$(DEPDIR)/SystemStarter-IPC.Tpo" -c -o SystemStarter-IPC.obj `if test -f 'IPC.c'; then $(CYGPATH_W) 'IPC.c'; else $(CYGPATH_W) '$(srcdir)/IPC.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-IPC.Tpo" "$(DEPDIR)/SystemStarter-IPC.Po"; else rm -f "$(DEPDIR)/SystemStarter-IPC.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IPC.c' object='SystemStarter-IPC.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-IPC.obj `if test -f 'IPC.c'; then $(CYGPATH_W) 'IPC.c'; else $(CYGPATH_W) '$(srcdir)/IPC.c'; fi` SystemStarter-SystemStarter.o: SystemStarter.c -@AMDEP_TRUE@ source='SystemStarter.c' object='SystemStarter-SystemStarter.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-SystemStarter.Po' tmpdepfile='$(DEPDIR)/SystemStarter-SystemStarter.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-SystemStarter.o `test -f 'SystemStarter.c' || echo '$(srcdir)/'`SystemStarter.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-SystemStarter.o -MD -MP -MF "$(DEPDIR)/SystemStarter-SystemStarter.Tpo" -c -o SystemStarter-SystemStarter.o `test -f 'SystemStarter.c' || echo '$(srcdir)/'`SystemStarter.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-SystemStarter.Tpo" "$(DEPDIR)/SystemStarter-SystemStarter.Po"; else rm -f "$(DEPDIR)/SystemStarter-SystemStarter.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SystemStarter.c' object='SystemStarter-SystemStarter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-SystemStarter.o `test -f 'SystemStarter.c' || echo '$(srcdir)/'`SystemStarter.c SystemStarter-SystemStarter.obj: SystemStarter.c -@AMDEP_TRUE@ source='SystemStarter.c' object='SystemStarter-SystemStarter.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/SystemStarter-SystemStarter.Po' tmpdepfile='$(DEPDIR)/SystemStarter-SystemStarter.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-SystemStarter.obj `cygpath -w SystemStarter.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -MT SystemStarter-SystemStarter.obj -MD -MP -MF "$(DEPDIR)/SystemStarter-SystemStarter.Tpo" -c -o SystemStarter-SystemStarter.obj `if test -f 'SystemStarter.c'; then $(CYGPATH_W) 'SystemStarter.c'; else $(CYGPATH_W) '$(srcdir)/SystemStarter.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/SystemStarter-SystemStarter.Tpo" "$(DEPDIR)/SystemStarter-SystemStarter.Po"; else rm -f "$(DEPDIR)/SystemStarter-SystemStarter.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SystemStarter.c' object='SystemStarter-SystemStarter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(SystemStarter_CFLAGS) $(CFLAGS) -c -o SystemStarter-SystemStarter.obj `if test -f 'SystemStarter.c'; then $(CYGPATH_W) 'SystemStarter.c'; else $(CYGPATH_W) '$(srcdir)/SystemStarter.c'; fi` launchctl-launchctl.o: launchctl.c -@AMDEP_TRUE@ source='launchctl.c' object='launchctl-launchctl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchctl-launchctl.Po' tmpdepfile='$(DEPDIR)/launchctl-launchctl.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -c -o launchctl-launchctl.o `test -f 'launchctl.c' || echo '$(srcdir)/'`launchctl.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -MT launchctl-launchctl.o -MD -MP -MF "$(DEPDIR)/launchctl-launchctl.Tpo" -c -o launchctl-launchctl.o `test -f 'launchctl.c' || echo '$(srcdir)/'`launchctl.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchctl-launchctl.Tpo" "$(DEPDIR)/launchctl-launchctl.Po"; else rm -f "$(DEPDIR)/launchctl-launchctl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchctl.c' object='launchctl-launchctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -c -o launchctl-launchctl.o `test -f 'launchctl.c' || echo '$(srcdir)/'`launchctl.c launchctl-launchctl.obj: launchctl.c -@AMDEP_TRUE@ source='launchctl.c' object='launchctl-launchctl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchctl-launchctl.Po' tmpdepfile='$(DEPDIR)/launchctl-launchctl.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -c -o launchctl-launchctl.obj `cygpath -w launchctl.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -MT launchctl-launchctl.obj -MD -MP -MF "$(DEPDIR)/launchctl-launchctl.Tpo" -c -o launchctl-launchctl.obj `if test -f 'launchctl.c'; then $(CYGPATH_W) 'launchctl.c'; else $(CYGPATH_W) '$(srcdir)/launchctl.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchctl-launchctl.Tpo" "$(DEPDIR)/launchctl-launchctl.Po"; else rm -f "$(DEPDIR)/launchctl-launchctl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchctl.c' object='launchctl-launchctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchctl_CFLAGS) $(CFLAGS) -c -o launchctl-launchctl.obj `if test -f 'launchctl.c'; then $(CYGPATH_W) 'launchctl.c'; else $(CYGPATH_W) '$(srcdir)/launchctl.c'; fi` launchd-launchd.o: launchd.c -@AMDEP_TRUE@ source='launchd.c' object='launchd-launchd.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd.Po' tmpdepfile='$(DEPDIR)/launchd-launchd.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd.o `test -f 'launchd.c' || echo '$(srcdir)/'`launchd.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd.o -MD -MP -MF "$(DEPDIR)/launchd-launchd.Tpo" -c -o launchd-launchd.o `test -f 'launchd.c' || echo '$(srcdir)/'`launchd.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd.Tpo" "$(DEPDIR)/launchd-launchd.Po"; else rm -f "$(DEPDIR)/launchd-launchd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd.c' object='launchd-launchd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd.o `test -f 'launchd.c' || echo '$(srcdir)/'`launchd.c launchd-launchd.obj: launchd.c -@AMDEP_TRUE@ source='launchd.c' object='launchd-launchd.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd.Po' tmpdepfile='$(DEPDIR)/launchd-launchd.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd.obj `cygpath -w launchd.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd.Tpo" -c -o launchd-launchd.obj `if test -f 'launchd.c'; then $(CYGPATH_W) 'launchd.c'; else $(CYGPATH_W) '$(srcdir)/launchd.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd.Tpo" "$(DEPDIR)/launchd-launchd.Po"; else rm -f "$(DEPDIR)/launchd-launchd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd.c' object='launchd-launchd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd.obj `if test -f 'launchd.c'; then $(CYGPATH_W) 'launchd.c'; else $(CYGPATH_W) '$(srcdir)/launchd.c'; fi` launchd-launchd_core_logic.o: launchd_core_logic.c -@AMDEP_TRUE@ source='launchd_core_logic.c' object='launchd-launchd_core_logic.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_core_logic.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_core_logic.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_core_logic.o `test -f 'launchd_core_logic.c' || echo '$(srcdir)/'`launchd_core_logic.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_core_logic.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_core_logic.Tpo" -c -o launchd-launchd_core_logic.o `test -f 'launchd_core_logic.c' || echo '$(srcdir)/'`launchd_core_logic.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_core_logic.Tpo" "$(DEPDIR)/launchd-launchd_core_logic.Po"; else rm -f "$(DEPDIR)/launchd-launchd_core_logic.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_core_logic.c' object='launchd-launchd_core_logic.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_core_logic.o `test -f 'launchd_core_logic.c' || echo '$(srcdir)/'`launchd_core_logic.c launchd-launchd_core_logic.obj: launchd_core_logic.c -@AMDEP_TRUE@ source='launchd_core_logic.c' object='launchd-launchd_core_logic.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_core_logic.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_core_logic.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_core_logic.obj `cygpath -w launchd_core_logic.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_core_logic.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_core_logic.Tpo" -c -o launchd-launchd_core_logic.obj `if test -f 'launchd_core_logic.c'; then $(CYGPATH_W) 'launchd_core_logic.c'; else $(CYGPATH_W) '$(srcdir)/launchd_core_logic.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_core_logic.Tpo" "$(DEPDIR)/launchd-launchd_core_logic.Po"; else rm -f "$(DEPDIR)/launchd-launchd_core_logic.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_core_logic.c' object='launchd-launchd_core_logic.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_core_logic.obj `if test -f 'launchd_core_logic.c'; then $(CYGPATH_W) 'launchd_core_logic.c'; else $(CYGPATH_W) '$(srcdir)/launchd_core_logic.c'; fi` launchd-launchd_unix_ipc.o: launchd_unix_ipc.c -@AMDEP_TRUE@ source='launchd_unix_ipc.c' object='launchd-launchd_unix_ipc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_unix_ipc.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_unix_ipc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_unix_ipc.o `test -f 'launchd_unix_ipc.c' || echo '$(srcdir)/'`launchd_unix_ipc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_unix_ipc.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo" -c -o launchd-launchd_unix_ipc.o `test -f 'launchd_unix_ipc.c' || echo '$(srcdir)/'`launchd_unix_ipc.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo" "$(DEPDIR)/launchd-launchd_unix_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_unix_ipc.c' object='launchd-launchd_unix_ipc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_unix_ipc.o `test -f 'launchd_unix_ipc.c' || echo '$(srcdir)/'`launchd_unix_ipc.c launchd-launchd_unix_ipc.obj: launchd_unix_ipc.c -@AMDEP_TRUE@ source='launchd_unix_ipc.c' object='launchd-launchd_unix_ipc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_unix_ipc.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_unix_ipc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_unix_ipc.obj `cygpath -w launchd_unix_ipc.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_unix_ipc.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo" -c -o launchd-launchd_unix_ipc.obj `if test -f 'launchd_unix_ipc.c'; then $(CYGPATH_W) 'launchd_unix_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_unix_ipc.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo" "$(DEPDIR)/launchd-launchd_unix_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_unix_ipc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_unix_ipc.c' object='launchd-launchd_unix_ipc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_unix_ipc.obj `if test -f 'launchd_unix_ipc.c'; then $(CYGPATH_W) 'launchd_unix_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_unix_ipc.c'; fi` launchd-launchd_mach_ipc.o: launchd_mach_ipc.c -@AMDEP_TRUE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_mach_ipc.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_mach_ipc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.o `test -f 'launchd_mach_ipc.c' || echo '$(srcdir)/'`launchd_mach_ipc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_mach_ipc.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" -c -o launchd-launchd_mach_ipc.o `test -f 'launchd_mach_ipc.c' || echo '$(srcdir)/'`launchd_mach_ipc.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" "$(DEPDIR)/launchd-launchd_mach_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.o `test -f 'launchd_mach_ipc.c' || echo '$(srcdir)/'`launchd_mach_ipc.c launchd-launchd_mach_ipc.obj: launchd_mach_ipc.c -@AMDEP_TRUE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_mach_ipc.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_mach_ipc.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.obj `cygpath -w launchd_mach_ipc.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_mach_ipc.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" -c -o launchd-launchd_mach_ipc.obj `if test -f 'launchd_mach_ipc.c'; then $(CYGPATH_W) 'launchd_mach_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_mach_ipc.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" "$(DEPDIR)/launchd-launchd_mach_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.obj `if test -f 'launchd_mach_ipc.c'; then $(CYGPATH_W) 'launchd_mach_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_mach_ipc.c'; fi` launchd-init.o: init.c -@AMDEP_TRUE@ source='init.c' object='launchd-init.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-init.Po' tmpdepfile='$(DEPDIR)/launchd-init.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-init.o `test -f 'init.c' || echo '$(srcdir)/'`init.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-init.o -MD -MP -MF "$(DEPDIR)/launchd-init.Tpo" -c -o launchd-init.o `test -f 'init.c' || echo '$(srcdir)/'`init.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-init.Tpo" "$(DEPDIR)/launchd-init.Po"; else rm -f "$(DEPDIR)/launchd-init.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='launchd-init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-init.o `test -f 'init.c' || echo '$(srcdir)/'`init.c launchd-init.obj: init.c -@AMDEP_TRUE@ source='init.c' object='launchd-init.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-init.Po' tmpdepfile='$(DEPDIR)/launchd-init.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-init.obj `cygpath -w init.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-init.obj -MD -MP -MF "$(DEPDIR)/launchd-init.Tpo" -c -o launchd-init.obj `if test -f 'init.c'; then $(CYGPATH_W) 'init.c'; else $(CYGPATH_W) '$(srcdir)/init.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-init.Tpo" "$(DEPDIR)/launchd-init.Po"; else rm -f "$(DEPDIR)/launchd-init.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='init.c' object='launchd-init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-init.obj `if test -f 'init.c'; then $(CYGPATH_W) 'init.c'; else $(CYGPATH_W) '$(srcdir)/init.c'; fi` launchd-bootstrapServer.o: bootstrapServer.c -@AMDEP_TRUE@ source='bootstrapServer.c' object='launchd-bootstrapServer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-bootstrapServer.Po' tmpdepfile='$(DEPDIR)/launchd-bootstrapServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-bootstrapServer.o `test -f 'bootstrapServer.c' || echo '$(srcdir)/'`bootstrapServer.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-bootstrapServer.o -MD -MP -MF "$(DEPDIR)/launchd-bootstrapServer.Tpo" -c -o launchd-bootstrapServer.o `test -f 'bootstrapServer.c' || echo '$(srcdir)/'`bootstrapServer.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-bootstrapServer.Tpo" "$(DEPDIR)/launchd-bootstrapServer.Po"; else rm -f "$(DEPDIR)/launchd-bootstrapServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bootstrapServer.c' object='launchd-bootstrapServer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-bootstrapServer.o `test -f 'bootstrapServer.c' || echo '$(srcdir)/'`bootstrapServer.c launchd-bootstrapServer.obj: bootstrapServer.c -@AMDEP_TRUE@ source='bootstrapServer.c' object='launchd-bootstrapServer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-bootstrapServer.Po' tmpdepfile='$(DEPDIR)/launchd-bootstrapServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-bootstrapServer.obj `cygpath -w bootstrapServer.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-bootstrapServer.obj -MD -MP -MF "$(DEPDIR)/launchd-bootstrapServer.Tpo" -c -o launchd-bootstrapServer.obj `if test -f 'bootstrapServer.c'; then $(CYGPATH_W) 'bootstrapServer.c'; else $(CYGPATH_W) '$(srcdir)/bootstrapServer.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-bootstrapServer.Tpo" "$(DEPDIR)/launchd-bootstrapServer.Po"; else rm -f "$(DEPDIR)/launchd-bootstrapServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bootstrapServer.c' object='launchd-bootstrapServer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-bootstrapServer.obj `if test -f 'bootstrapServer.c'; then $(CYGPATH_W) 'bootstrapServer.c'; else $(CYGPATH_W) '$(srcdir)/bootstrapServer.c'; fi` launchd-notifyServer.o: notifyServer.c -@AMDEP_TRUE@ source='notifyServer.c' object='launchd-notifyServer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-notifyServer.Po' tmpdepfile='$(DEPDIR)/launchd-notifyServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-notifyServer.o `test -f 'notifyServer.c' || echo '$(srcdir)/'`notifyServer.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-notifyServer.o -MD -MP -MF "$(DEPDIR)/launchd-notifyServer.Tpo" -c -o launchd-notifyServer.o `test -f 'notifyServer.c' || echo '$(srcdir)/'`notifyServer.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-notifyServer.Tpo" "$(DEPDIR)/launchd-notifyServer.Po"; else rm -f "$(DEPDIR)/launchd-notifyServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='notifyServer.c' object='launchd-notifyServer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-notifyServer.o `test -f 'notifyServer.c' || echo '$(srcdir)/'`notifyServer.c launchd-notifyServer.obj: notifyServer.c -@AMDEP_TRUE@ source='notifyServer.c' object='launchd-notifyServer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-notifyServer.Po' tmpdepfile='$(DEPDIR)/launchd-notifyServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-notifyServer.obj `cygpath -w notifyServer.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-notifyServer.obj -MD -MP -MF "$(DEPDIR)/launchd-notifyServer.Tpo" -c -o launchd-notifyServer.obj `if test -f 'notifyServer.c'; then $(CYGPATH_W) 'notifyServer.c'; else $(CYGPATH_W) '$(srcdir)/notifyServer.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-notifyServer.Tpo" "$(DEPDIR)/launchd-notifyServer.Po"; else rm -f "$(DEPDIR)/launchd-notifyServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='notifyServer.c' object='launchd-notifyServer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-notifyServer.obj `if test -f 'notifyServer.c'; then $(CYGPATH_W) 'notifyServer.c'; else $(CYGPATH_W) '$(srcdir)/notifyServer.c'; fi` launchd-launchd_internalUser.o: launchd_internalUser.c -@AMDEP_TRUE@ source='launchd_internalUser.c' object='launchd-launchd_internalUser.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_internalUser.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_internalUser.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalUser.o `test -f 'launchd_internalUser.c' || echo '$(srcdir)/'`launchd_internalUser.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_internalUser.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_internalUser.Tpo" -c -o launchd-launchd_internalUser.o `test -f 'launchd_internalUser.c' || echo '$(srcdir)/'`launchd_internalUser.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_internalUser.Tpo" "$(DEPDIR)/launchd-launchd_internalUser.Po"; else rm -f "$(DEPDIR)/launchd-launchd_internalUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_internalUser.c' object='launchd-launchd_internalUser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalUser.o `test -f 'launchd_internalUser.c' || echo '$(srcdir)/'`launchd_internalUser.c launchd-launchd_internalUser.obj: launchd_internalUser.c -@AMDEP_TRUE@ source='launchd_internalUser.c' object='launchd-launchd_internalUser.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_internalUser.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_internalUser.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalUser.obj `cygpath -w launchd_internalUser.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_internalUser.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_internalUser.Tpo" -c -o launchd-launchd_internalUser.obj `if test -f 'launchd_internalUser.c'; then $(CYGPATH_W) 'launchd_internalUser.c'; else $(CYGPATH_W) '$(srcdir)/launchd_internalUser.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_internalUser.Tpo" "$(DEPDIR)/launchd-launchd_internalUser.Po"; else rm -f "$(DEPDIR)/launchd-launchd_internalUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_internalUser.c' object='launchd-launchd_internalUser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalUser.obj `if test -f 'launchd_internalUser.c'; then $(CYGPATH_W) 'launchd_internalUser.c'; else $(CYGPATH_W) '$(srcdir)/launchd_internalUser.c'; fi` launchd-launchd_internalServer.o: launchd_internalServer.c -@AMDEP_TRUE@ source='launchd_internalServer.c' object='launchd-launchd_internalServer.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_internalServer.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_internalServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalServer.o `test -f 'launchd_internalServer.c' || echo '$(srcdir)/'`launchd_internalServer.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_internalServer.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_internalServer.Tpo" -c -o launchd-launchd_internalServer.o `test -f 'launchd_internalServer.c' || echo '$(srcdir)/'`launchd_internalServer.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_internalServer.Tpo" "$(DEPDIR)/launchd-launchd_internalServer.Po"; else rm -f "$(DEPDIR)/launchd-launchd_internalServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_internalServer.c' object='launchd-launchd_internalServer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalServer.o `test -f 'launchd_internalServer.c' || echo '$(srcdir)/'`launchd_internalServer.c launchd-launchd_internalServer.obj: launchd_internalServer.c -@AMDEP_TRUE@ source='launchd_internalServer.c' object='launchd-launchd_internalServer.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-launchd_internalServer.Po' tmpdepfile='$(DEPDIR)/launchd-launchd_internalServer.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalServer.obj `cygpath -w launchd_internalServer.c` +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_internalServer.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_internalServer.Tpo" -c -o launchd-launchd_internalServer.obj `if test -f 'launchd_internalServer.c'; then $(CYGPATH_W) 'launchd_internalServer.c'; else $(CYGPATH_W) '$(srcdir)/launchd_internalServer.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_internalServer.Tpo" "$(DEPDIR)/launchd-launchd_internalServer.Po"; else rm -f "$(DEPDIR)/launchd-launchd_internalServer.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_internalServer.c' object='launchd-launchd_internalServer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalServer.obj `if test -f 'launchd_internalServer.c'; then $(CYGPATH_W) 'launchd_internalServer.c'; else $(CYGPATH_W) '$(srcdir)/launchd_internalServer.c'; fi` launchd-mpm_replyUser.o: mpm_replyUser.c -@AMDEP_TRUE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-mpm_replyUser.Po' tmpdepfile='$(DEPDIR)/launchd-mpm_replyUser.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.o `test -f 'mpm_replyUser.c' || echo '$(srcdir)/'`mpm_replyUser.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-mpm_replyUser.o -MD -MP -MF "$(DEPDIR)/launchd-mpm_replyUser.Tpo" -c -o launchd-mpm_replyUser.o `test -f 'mpm_replyUser.c' || echo '$(srcdir)/'`mpm_replyUser.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo" "$(DEPDIR)/launchd-mpm_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.o `test -f 'mpm_replyUser.c' || echo '$(srcdir)/'`mpm_replyUser.c launchd-mpm_replyUser.obj: mpm_replyUser.c -@AMDEP_TRUE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@ depfile='$(DEPDIR)/launchd-mpm_replyUser.Po' tmpdepfile='$(DEPDIR)/launchd-mpm_replyUser.TPo' @AMDEPBACKSLASH@ -@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ - $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.obj `cygpath -w mpm_replyUser.c` -CCDEPMODE = @CCDEPMODE@ +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-mpm_replyUser.obj -MD -MP -MF "$(DEPDIR)/launchd-mpm_replyUser.Tpo" -c -o launchd-mpm_replyUser.obj `if test -f 'mpm_replyUser.c'; then $(CYGPATH_W) 'mpm_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/mpm_replyUser.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo" "$(DEPDIR)/launchd-mpm_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.obj `if test -f 'mpm_replyUser.c'; then $(CYGPATH_W) 'mpm_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/mpm_replyUser.c'; fi` uninstall-info-am: - -man1dir = $(mandir)/man1 install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man1dir) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -639,8 +694,8 @@ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @@ -653,17 +708,19 @@ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done - -man5dir = $(mandir)/man5 install-man5: $(man5_MANS) $(man_MANS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man5dir) + test -z "$(man5dir)" || $(mkdir_p) "$(DESTDIR)$(man5dir)" @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -682,8 +739,8 @@ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ done uninstall-man5: @$(NORMAL_UNINSTALL) @@ -696,17 +753,19 @@ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \ - rm -f $(DESTDIR)$(man5dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ done - -man8dir = $(mandir)/man8 install-man8: $(man8_MANS) $(man_MANS) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(man8dir) + test -z "$(man8dir)" || $(mkdir_p) "$(DESTDIR)$(man8dir)" @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ @@ -725,8 +784,8 @@ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ done uninstall-man8: @$(NORMAL_UNINSTALL) @@ -739,36 +798,34 @@ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ - rm -f $(DESTDIR)$(man8dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ done -sysconfDATA_INSTALL = $(INSTALL_DATA) install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(sysconfdir) + test -z "$(sysconfdir)" || $(mkdir_p) "$(DESTDIR)$(sysconfdir)" @list='$(sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " $(sysconfDATA_INSTALL) $$d$$p $(DESTDIR)$(sysconfdir)/$$f"; \ - $(sysconfDATA_INSTALL) $$d$$p $(DESTDIR)$(sysconfdir)/$$f; \ + f=$(am__strip_dir) \ + echo " $(sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ + $(sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ done uninstall-sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(sysconf_DATA)'; for p in $$list; do \ - f="`echo $$p | sed -e 's|^.*/||'`"; \ - echo " rm -f $(DESTDIR)$(sysconfdir)/$$f"; \ - rm -f $(DESTDIR)$(sysconfdir)/$$f; \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ + rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ done -ETAGS = etags -ETAGSFLAGS = - -tags: TAGS - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -777,6 +834,7 @@ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique +tags: TAGS TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -788,8 +846,24 @@ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)$$tags$$unique" \ - || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: @@ -798,19 +872,21 @@ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -top_distdir = .. -distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - distdir: $(DISTFILES) - @list='$(DISTFILES)'; for file in $$list; do \ + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ - $(mkinstalldirs) "$(distdir)$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ @@ -829,10 +905,10 @@ check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ config.h - installdirs: - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir) $(DESTDIR)$(man8dir) $(DESTDIR)$(sysconfdir) - + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(sysconfdir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -844,7 +920,7 @@ installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - INSTALL_STRIP_FLAG=-s \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -853,7 +929,7 @@ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -864,14 +940,17 @@ clean-noinstLIBRARIES clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags -distclean-am: clean-am distclean-compile distclean-depend \ - distclean-generic distclean-hdr distclean-tags - dvi: dvi-am dvi-am: +html: html-am + info: info-am info-am: @@ -890,31 +969,41 @@ installcheck-am: maintainer-clean: maintainer-clean-am - + -rm -rf ./$(DEPDIR) + -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + uninstall-am: uninstall-binPROGRAMS uninstall-info-am \ uninstall-libexecPROGRAMS uninstall-man uninstall-sbinPROGRAMS \ uninstall-sbinSCRIPTS uninstall-sysconfDATA uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8 -.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libexecPROGRAMS clean-noinstLIBRARIES \ - clean-sbinPROGRAMS distclean distclean-compile distclean-depend \ + clean-sbinPROGRAMS ctags distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distdir dvi \ - dvi-am info info-am install install-am install-binPROGRAMS \ - install-data install-data-am install-exec install-exec-am \ - install-info install-info-am install-libexecPROGRAMS \ - install-man install-man1 install-man5 install-man8 \ - install-sbinPROGRAMS install-sbinSCRIPTS install-strip \ - install-sysconfDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic tags uninstall \ + dvi-am html html-am info info-am install install-am \ + install-binPROGRAMS install-data install-data-am \ + install-data-hook install-exec install-exec-am install-info \ + install-info-am install-libexecPROGRAMS install-man \ + install-man1 install-man5 install-man8 install-sbinPROGRAMS \ + install-sbinSCRIPTS install-strip install-sysconfDATA \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am \ uninstall-libexecPROGRAMS uninstall-man uninstall-man1 \ uninstall-man5 uninstall-man8 uninstall-sbinPROGRAMS \ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060907/b10b36a3/attachment.html From source_changes at macosforge.org Thu Sep 7 13:26:12 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22845] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060907202612.D422221C2420@cvs.opensource.apple.com> Revision: 22845 Author: zarzycki@apple.com Date: 2006-09-07 13:26:11 -0700 (Thu, 07 Sep 2006) Log Message: ----------- Unknown value for key LimitLoadToSessionType: Aqua Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-07 19:52:41 UTC (rev 22844) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-07 20:26:11 UTC (rev 22845) @@ -887,8 +887,15 @@ break; case 'l': case 'L': - if (strcasecmp(key, LAUNCH_JOBKEY_LABEL) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_LABEL) == 0) { return; + } else if (strcasecmp(key, LAUNCH_JOBKEY_LIMITLOADTOHOSTS) == 0) { + return; + } else if (strcasecmp(key, LAUNCH_JOBKEY_LIMITLOADFROMHOSTS) == 0) { + return; + } else if (strcasecmp(key, LAUNCH_JOBKEY_LIMITLOADTOSESSIONTYPE) == 0) { + return; + } break; case 'r': case 'R': -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060907/7ef40a2a/attachment.html From source_changes at macosforge.org Thu Sep 7 21:27:19 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22846] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060908042719.667D721C3A4E@cvs.opensource.apple.com> Revision: 22846 Author: zarzycki@apple.com Date: 2006-09-07 21:27:17 -0700 (Thu, 07 Sep 2006) Log Message: ----------- Jobs that are being throttled must ignore their Mach ports or Unix sockets for that duration. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-07 20:26:11 UTC (rev 22845) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-08 04:27:17 UTC (rev 22846) @@ -1429,6 +1429,7 @@ job_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); job_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); + job_ignore(j); return; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060907/77f7ce7b/attachment.html From source_changes at macosforge.org Thu Sep 7 21:27:54 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22847] tags/launchd-159/ Message-ID: <20060908042754.6710621C3A72@cvs.opensource.apple.com> Revision: 22847 Author: zarzycki@apple.com Date: 2006-09-07 21:27:53 -0700 (Thu, 07 Sep 2006) Log Message: ----------- "Tagging launchd-159 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-159/ Copied: tags/launchd-159 (from rev 22846, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060907/5f1996f7/attachment.html From source_changes at macosforge.org Fri Sep 8 09:26:05 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22848] trunk/launchd/src Message-ID: <20060908162605.3E3A421C4C24@cvs.opensource.apple.com> Revision: 22848 Author: zarzycki@apple.com Date: 2006-09-08 09:26:03 -0700 (Fri, 08 Sep 2006) Log Message: ----------- automake me harder... Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-08 04:27:53 UTC (rev 22847) +++ trunk/launchd/src/Makefile.am 2006-09-08 16:26:03 UTC (rev 22848) @@ -14,7 +14,7 @@ liblaunch_profile_a_CFLAGS = -pg $(AM_CFLAGS) liblaunch_profile_a_SOURCES = liblaunch.c bootstrap_public.c -bootstrap_public.c:: bootstrap.h +$(srcdir)/bootstrap_public.c:: bootstrap.h install-data-hook: mkdir -p $(DESTDIR)/usr/local/lib/system Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-08 04:27:53 UTC (rev 22847) +++ trunk/launchd/src/Makefile.in 2006-09-08 16:26:03 UTC (rev 22848) @@ -1013,7 +1013,7 @@ bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/bootstrap.defs mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/bootstrap.defs -@LIBS_ONLY_TRUE@bootstrap_public.c:: bootstrap.h +@LIBS_ONLY_TRUE@$(srcdir)/bootstrap_public.c:: bootstrap.h @LIBS_ONLY_TRUE@install-data-hook: @LIBS_ONLY_TRUE@ mkdir -p $(DESTDIR)/usr/local/lib/system -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060908/df5e2898/attachment.html From source_changes at macosforge.org Fri Sep 8 09:26:16 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22849] tags/launchd-160/ Message-ID: <20060908162616.39B3321C4C36@cvs.opensource.apple.com> Revision: 22849 Author: zarzycki@apple.com Date: 2006-09-08 09:26:14 -0700 (Fri, 08 Sep 2006) Log Message: ----------- "Tagging launchd-160 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-160/ Copied: tags/launchd-160 (from rev 22848, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060908/05a667fa/attachment.html From source_changes at macosforge.org Mon Sep 11 14:08:30 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22850] trunk/launchd/src Message-ID: <20060911210830.90E1C21EA99F@cvs.opensource.apple.com> Revision: 22850 Author: zarzycki@apple.com Date: 2006-09-11 14:08:28 -0700 (Mon, 11 Sep 2006) Log Message: ----------- Consolidate OS runtime support into a file to ease porting. Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in trunk/launchd/src/init.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd.h trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_unix_ipc.c Added Paths: ----------- trunk/launchd/src/launchd_runtime.c trunk/launchd/src/launchd_runtime.h Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/Makefile.am 2006-09-11 21:08:28 UTC (rev 22850) @@ -41,11 +41,12 @@ launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden launchd_LDFLAGS = -lbsm -launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c +launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c -launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h notifyServer.h launchd_internal.h +launchd_runtime.c:: notifyServer.h launchd_internal.h +launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h launchd_core_logic.c:: bootstrap.h mpm_reply.h -launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h +#launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h launchproxy_LDFLAGS = -weak_framework Security Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/Makefile.in 2006-09-11 21:08:28 UTC (rev 22850) @@ -88,7 +88,7 @@ am__launchd_SOURCES_DIST = launchd.c launchd_core_logic.c \ launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c \ notifyServer.c launchd_internalUser.c launchd_internalServer.c \ - mpm_replyUser.c + mpm_replyUser.c launchd_runtime.c @LIBS_ONLY_FALSE@am_launchd_OBJECTS = launchd-launchd.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_core_logic.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_unix_ipc.$(OBJEXT) \ @@ -98,7 +98,8 @@ @LIBS_ONLY_FALSE@ launchd-notifyServer.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_internalUser.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_internalServer.$(OBJEXT) \ -@LIBS_ONLY_FALSE@ launchd-mpm_replyUser.$(OBJEXT) +@LIBS_ONLY_FALSE@ launchd-mpm_replyUser.$(OBJEXT) \ +@LIBS_ONLY_FALSE@ launchd-launchd_runtime.$(OBJEXT) launchd_OBJECTS = $(am_launchd_OBJECTS) launchd_LDADD = $(LDADD) launchproxy_SOURCES = launchproxy.c @@ -236,7 +237,8 @@ @LIBS_ONLY_FALSE@SystemStarter_SOURCES = StartupItems.c IPC.c SystemStarter.c @LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden @LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm -@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c +@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c +#launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h @LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security @LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 @LIBS_ONLY_FALSE@man5_MANS = launchd.plist.5 launchd.conf.5 @@ -426,6 +428,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalUser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_mach_ipc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_runtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_unix_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-mpm_replyUser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-notifyServer.Po@am__quote@ @@ -672,6 +675,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.obj `if test -f 'mpm_replyUser.c'; then $(CYGPATH_W) 'mpm_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/mpm_replyUser.c'; fi` + +launchd-launchd_runtime.o: launchd_runtime.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_runtime.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_runtime.Tpo" -c -o launchd-launchd_runtime.o `test -f 'launchd_runtime.c' || echo '$(srcdir)/'`launchd_runtime.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_runtime.Tpo" "$(DEPDIR)/launchd-launchd_runtime.Po"; else rm -f "$(DEPDIR)/launchd-launchd_runtime.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_runtime.c' object='launchd-launchd_runtime.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_runtime.o `test -f 'launchd_runtime.c' || echo '$(srcdir)/'`launchd_runtime.c + +launchd-launchd_runtime.obj: launchd_runtime.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_runtime.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_runtime.Tpo" -c -o launchd-launchd_runtime.obj `if test -f 'launchd_runtime.c'; then $(CYGPATH_W) 'launchd_runtime.c'; else $(CYGPATH_W) '$(srcdir)/launchd_runtime.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_runtime.Tpo" "$(DEPDIR)/launchd-launchd_runtime.Po"; else rm -f "$(DEPDIR)/launchd-launchd_runtime.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_runtime.c' object='launchd-launchd_runtime.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_runtime.obj `if test -f 'launchd_runtime.c'; then $(CYGPATH_W) 'launchd_runtime.c'; else $(CYGPATH_W) '$(srcdir)/launchd_runtime.c'; fi` uninstall-info-am: install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) @@ -1021,9 +1038,9 @@ @LIBS_ONLY_TRUE@ cp liblaunch.a $(DESTDIR)/usr/local/lib/system/liblaunch_debug.a @LIBS_ONLY_TRUE@ cp liblaunch_profile.a $(DESTDIR)/usr/local/lib/system/liblaunch_profile.a -@LIBS_ONLY_FALSE@launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h notifyServer.h launchd_internal.h +@LIBS_ONLY_FALSE@launchd_runtime.c:: notifyServer.h launchd_internal.h +@LIBS_ONLY_FALSE@launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h @LIBS_ONLY_FALSE@launchd_core_logic.c:: bootstrap.h mpm_reply.h -@LIBS_ONLY_FALSE@launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h @LIBS_ONLY_FALSE@notifyServer.c notifyServer.h: /usr/include/mach/notify.defs @LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -header /dev/null -user /dev/null -sheader notifyServer.h /usr/include/mach/notify.defs Modified: trunk/launchd/src/init.c =================================================================== --- trunk/launchd/src/init.c 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/init.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -87,6 +87,7 @@ #include #include "launchd.h" +#include "launchd_runtime.h" #define _PATH_RUNCOM "/etc/rc" Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/launchd.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -59,7 +59,6 @@ #include #include #include -#include #include #include "bootstrap_public.h" @@ -67,25 +66,10 @@ #include "launch.h" #include "launch_priv.h" #include "launchd.h" +#include "launchd_runtime.h" #include "launchd_core_logic.h" #include "launchd_unix_ipc.h" -#include "launchd_internalServer.h" -#include "launchd_internal.h" -#include "notifyServer.h" -#include "bootstrapServer.h" - -union MaxRequestSize { - union __RequestUnion__do_notify_subsystem req; - union __ReplyUnion__do_notify_subsystem rep; - union __RequestUnion__x_launchd_internal_subsystem req2; - union __ReplyUnion__x_launchd_internal_subsystem rep2; - union __RequestUnion__x_bootstrap_subsystem req3; - union __ReplyUnion__x_bootstrap_subsystem rep3; -}; - -static boolean_t launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply); - #define PID1LAUNCHD_CONF "/etc/launchd.conf" #define LAUNCHD_CONF ".launchd.conf" #define LAUNCHCTL_PATH "/bin/launchctl" @@ -93,13 +77,11 @@ extern char **environ; -static void async_callback(void); static void signal_callback(void *, struct kevent *); static void fs_callback(void); static void ppidexit_callback(void); static void pfsystem_callback(void *, struct kevent *); -static kq_callback kqasync_callback = (kq_callback)async_callback; static kq_callback kqsignal_callback = signal_callback; static kq_callback kqfs_callback = (kq_callback)fs_callback; static kq_callback kqppidexit_callback = (kq_callback)ppidexit_callback; @@ -112,12 +94,8 @@ static void testfd_or_openfd(int fd, const char *path, int flags); static bool get_network_state(void); static void monitor_networking_state(void); -static void *kqueue_demand_loop(void *arg); static void fatal_signal_handler(int sig); -static pthread_t kqueue_demand_thread; -static int mainkq = 0; -static int asynckq = 0; static bool re_exec_in_single_user_mode = false; static char *pending_stdout = NULL; static char *pending_stderr = NULL; @@ -128,8 +106,6 @@ bool shutdown_in_progress = false; bool network_up = false; int batch_disabler_count = 0; -mach_port_t launchd_internal_port = MACH_PORT_NULL; -mach_port_t ipc_port_set = MACH_PORT_NULL; int main(int argc, char *const *argv) @@ -147,7 +123,6 @@ const char *h = getenv("HOME"); const char *session_type = NULL; const char *optargs = NULL; - launch_data_t ldresp, ldmsg = launch_data_new_string(LAUNCH_KEY_CHECKIN); job_t fbj = NULL; struct stat sb; size_t i, checkin_fdcnt = 0; @@ -156,55 +131,68 @@ mach_port_t checkin_mport = MACH_PORT_NULL; int ch, ker, logopts; + testfd_or_openfd(STDIN_FILENO, _PATH_DEVNULL, O_RDONLY); + testfd_or_openfd(STDOUT_FILENO, _PATH_DEVNULL, O_WRONLY); + testfd_or_openfd(STDERR_FILENO, _PATH_DEVNULL, O_WRONLY); + /* main() phase one: sanitize the process */ - if (getpid() != 1 && (ldresp = launch_msg(ldmsg)) && launch_data_get_type(ldresp) == LAUNCH_DATA_DICTIONARY) { - const char *ldlabel = launch_data_get_string(launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_LABEL)); - launch_data_t tmp; + if (getpid() != 1) { + launch_data_t ldresp, ldmsg = launch_data_new_string(LAUNCH_KEY_CHECKIN); - if ((tmp = launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_SOCKETS))) { - if ((tmp = launch_data_dict_lookup(tmp, "LaunchIPC"))) { - checkin_fdcnt = launch_data_array_get_count(tmp); - checkin_fds = alloca(sizeof(int) * checkin_fdcnt); - for (i = 0; i < checkin_fdcnt; i++) { - checkin_fds[i] = _fd(launch_data_get_fd(launch_data_array_get_index(tmp, i))); + if ((ldresp = launch_msg(ldmsg))) { + if (launch_data_get_type(ldresp) == LAUNCH_DATA_DICTIONARY) { + const char *ldlabel = launch_data_get_string(launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_LABEL)); + launch_data_t tmp; + + if ((tmp = launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_SOCKETS))) { + if ((tmp = launch_data_dict_lookup(tmp, "LaunchIPC"))) { + checkin_fdcnt = launch_data_array_get_count(tmp); + checkin_fds = alloca(sizeof(int) * checkin_fdcnt); + for (i = 0; i < checkin_fdcnt; i++) { + checkin_fds[i] = _fd(launch_data_get_fd(launch_data_array_get_index(tmp, i))); + } + } } + if ((tmp = launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_MACHSERVICES))) { + if ((tmp = launch_data_dict_lookup(tmp, ldlabel))) { + checkin_mport = launch_data_get_machport(tmp); + } + } } - } - if ((tmp = launch_data_dict_lookup(ldresp, LAUNCH_JOBKEY_MACHSERVICES))) { - if ((tmp = launch_data_dict_lookup(tmp, ldlabel))) { - checkin_mport = launch_data_get_machport(tmp); - } - } - launch_data_free(ldresp); - } else { - int sigi, fdi, dts = getdtablesize(); - sigset_t emptyset; + launch_data_free(ldresp); + } else { + int sigi, fdi, dts = getdtablesize(); + sigset_t emptyset; - for (fdi = STDERR_FILENO + 1; fdi < dts; fdi++) - close(fdi); - for (sigi = 1; sigi < NSIG; sigi++) { - switch (sigi) { - case SIGKILL: - case SIGSTOP: - break; - default: - launchd_assumes(signal(sigi, SIG_DFL) != SIG_ERR); - break; + /* We couldn't check-in. + * + * Assume the worst and clean up whatever mess our parent process left us with... + */ + + for (fdi = STDERR_FILENO + 1; fdi < dts; fdi++) + close(fdi); + for (sigi = 1; sigi < NSIG; sigi++) { + switch (sigi) { + case SIGKILL: + case SIGSTOP: + break; + default: + launchd_assumes(signal(sigi, SIG_DFL) != SIG_ERR); + break; + } } + sigemptyset(&emptyset); + launchd_assumes(sigprocmask(SIG_SETMASK, &emptyset, NULL) == 0); } - sigemptyset(&emptyset); - launchd_assumes(sigprocmask(SIG_SETMASK, &emptyset, NULL) == 0); + + launch_data_free(ldmsg); } - launch_data_free(ldmsg); + launchd_runtime_init(); - testfd_or_openfd(STDIN_FILENO, _PATH_DEVNULL, O_RDONLY|O_NOCTTY); - testfd_or_openfd(STDOUT_FILENO, _PATH_DEVNULL, O_WRONLY|O_NOCTTY); - testfd_or_openfd(STDERR_FILENO, _PATH_DEVNULL, O_WRONLY|O_NOCTTY); + /* main() phase two: parse arguments */ - /* main phase two: parse arguments */ - if (getpid() == 1) { optargs = "s"; } else { @@ -233,11 +221,6 @@ if (dflag) launchd_assumes(daemon(0, 0) == 0); - launchd_assert((errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &ipc_port_set)) == KERN_SUCCESS); - launchd_assert(launchd_mport_create_recv(&launchd_internal_port) == KERN_SUCCESS); - launchd_assert(launchd_mport_make_send(launchd_internal_port) == KERN_SUCCESS); - launchd_assert((errno = mach_port_move_member(mach_task_self(), launchd_internal_port, ipc_port_set)) == KERN_SUCCESS); - logopts = LOG_PID|LOG_CONS; if (Dflag) logopts |= LOG_PERROR; @@ -245,12 +228,6 @@ openlog(getprogname(), logopts, LOG_LAUNCHD); setlogmask(LOG_UPTO(Dflag ? LOG_DEBUG : LOG_NOTICE)); - launchd_assert((mainkq = kqueue()) != -1); - - launchd_assert((asynckq = kqueue()) != -1); - - launchd_assert(kevent_mod(asynckq, EVFILT_READ, EV_ADD, 0, 0, &kqasync_callback) != -1); - sigemptyset(&blocked_signals); for (i = 0; i < (sizeof(sigigns) / sizeof(int)); i++) { @@ -327,16 +304,6 @@ if (fbj) job_dispatch(fbj, true); - pthread_attr_t attr; - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); - launchd_assert(pthread_create(&kqueue_demand_thread, &attr, kqueue_demand_loop, NULL) == 0); - pthread_attr_destroy(&attr); - - mach_msg_return_t msgr; - mach_msg_size_t mxmsgsz = sizeof(union MaxRequestSize) + MAX_TRAILER_SIZE; - if (getpid() == 1 && !job_active(rlcj)) init_pre_kevent(); @@ -346,12 +313,7 @@ launchd_assumes(signal(SIGBUS, fatal_signal_handler) != SIG_ERR); launchd_assumes(signal(SIGSEGV, fatal_signal_handler) != SIG_ERR); - for (;;) { - msgr = mach_msg_server(launchd_internal_demux, mxmsgsz, ipc_port_set, - MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) | - MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0)); - launchd_assumes(msgr == MACH_MSG_SUCCESS); - } + launchd_runtime(); } void @@ -360,56 +322,6 @@ longjmp(doom_doom_doom, sig); } -void * -kqueue_demand_loop(void *arg __attribute__((unused))) -{ - fd_set rfds; - - for (;;) { - FD_ZERO(&rfds); - FD_SET(mainkq, &rfds); - if (launchd_assumes(select(mainkq + 1, &rfds, NULL, NULL, NULL) == 1)) - launchd_assumes(handle_kqueue(launchd_internal_port, mainkq) == 0); - } - - return NULL; -} - -kern_return_t -x_handle_kqueue(mach_port_t junk __attribute__((unused)), integer_t fd) -{ - struct timespec ts = { 0, 0 }; - struct kevent kev; - int kevr; - - launchd_assumes((kevr = kevent(fd, NULL, 0, &kev, 1, &ts)) != -1); - - if (kevr == 1) - (*((kq_callback *)kev.udata))(kev.udata, &kev); - - if (shutdown_in_progress && total_children == 0) { - mach_init_reap(); - - shutdown_in_progress = false; - - if (getpid() != 1) { - exit(EXIT_SUCCESS); - } else if (re_exec_in_single_user_mode) { - re_exec_in_single_user_mode = false; - launchd_assumes(execl("/sbin/launchd", "/sbin/launchd", "-s", NULL) != -1); - } - } - - if (getpid() == 1) { - if (rlcj && job_active(rlcj)) - goto out; - init_pre_kevent(); - } - -out: - return 0; -} - void pid1_magic_init(bool sflag) { @@ -445,24 +357,6 @@ } int -kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata) -{ - struct kevent kev; - int q = mainkq; - - if (EVFILT_TIMER == filter || EVFILT_VNODE == filter) - q = asynckq; - - if (flags & EV_ADD && !launchd_assumes(udata != NULL)) { - errno = EINVAL; - return -1; - } - - EV_SET(&kev, ident, filter, flags, fflags, data, udata); - return kevent(q, &kev, 1, NULL, 0, NULL); -} - -int _fd(int fd) { if (fd >= 0) @@ -489,7 +383,7 @@ shutdown_in_progress = true; - launchd_assumes(close(asynckq) != -1); + runtime_force_on_demand(true); rlcj = NULL; @@ -577,16 +471,6 @@ } void -async_callback(void) -{ - struct timespec timeout = { 0, 0 }; - struct kevent kev; - - if (launchd_assumes(kevent(asynckq, NULL, 0, &kev, 1, &timeout) == 1)) - (*((kq_callback *)kev.udata))(kev.udata, &kev); -} - -void testfd_or_openfd(int fd, const char *path, int flags) { int tmpfd; @@ -594,7 +478,7 @@ if (-1 != (tmpfd = dup(fd))) { launchd_assumes(close(tmpfd) == 0); } else { - if (-1 == (tmpfd = open(path, flags))) { + if (-1 == (tmpfd = open(path, flags | O_NOCTTY, DEFFILEMODE))) { syslog(LOG_ERR, "open(\"%s\", ...): %m", path); } else if (tmpfd != fd) { launchd_assumes(dup2(tmpfd, fd) != -1); @@ -632,10 +516,10 @@ batch_disabler_count--; c->disabled_batch = 0; if (batch_disabler_count == 0) - kevent_mod(asynckq, EVFILT_READ, EV_ENABLE, 0, 0, &kqasync_callback); + runtime_force_on_demand(false); } else if (!e && !c->disabled_batch) { if (batch_disabler_count == 0) - kevent_mod(asynckq, EVFILT_READ, EV_DISABLE, 0, 0, &kqasync_callback); + runtime_force_on_demand(true); batch_disabler_count++; c->disabled_batch = 1; } @@ -756,21 +640,22 @@ return false; } -boolean_t -launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) +void +launchd_post_kevent(void) { - if (gc_this_job) { - job_remove(gc_this_job); - gc_this_job = NULL; - } + if (shutdown_in_progress && total_children == 0) { + shutdown_in_progress = false; - if (Request->msgh_local_port == launchd_internal_port) { - if (launchd_internal_server_routine(Request)) - return launchd_internal_server(Request, Reply); - } else { - if (bootstrap_server_routine(Request)) - return bootstrap_server(Request, Reply); + if (getpid() != 1) { + exit(EXIT_SUCCESS); + } else if (re_exec_in_single_user_mode) { + re_exec_in_single_user_mode = false; + launchd_assumes(execl("/sbin/launchd", "/sbin/launchd", "-s", NULL) != -1); + } } - - return notify_server(Request, Reply); + if (getpid() == 1) { + if (rlcj && job_active(rlcj)) + return; + init_pre_kevent(); + } } Modified: trunk/launchd/src/launchd.h =================================================================== --- trunk/launchd/src/launchd.h 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/launchd.h 2006-09-11 21:08:28 UTC (rev 22850) @@ -23,59 +23,34 @@ #include #include #include "launch.h" +#include "launchd_runtime.h" #include "bootstrap_public.h" -/* - * Use launchd_assumes() when we can recover, even if it means we leak or limp along. - * - * Use launchd_assert() for core initialization routines. - */ -#define launchd_assumes(e) \ - (__builtin_expect(!(e), 0) ? _log_launchd_bug(__rcs_file_version__, __FILE__, __LINE__, #e), false : true) - -#define launchd_blame(e, b) \ - (__builtin_expect(!(e), 0) ? syslog(LOG_DEBUG, "Encountered bug: %d", b), false : true) - -#define launchd_assert(e) launchd_assumes(e) ? true : abort(); - #define FIRSTBORN_LABEL "com.apple.launchd.firstborn" #define READCONF_LABEL "com.apple.launchd.readconfig" struct kevent; struct conncb; -typedef void (*kq_callback)(void *, struct kevent *); - extern kq_callback kqsimple_zombie_reaper; extern sigset_t blocked_signals; extern bool shutdown_in_progress; extern bool network_up; extern int batch_disabler_count; -extern mach_port_t launchd_internal_port; -extern mach_port_t ipc_port_set; +extern mach_port_t inherited_bootstrap_port; bool init_check_pid(pid_t); -int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); void batch_job_enable(bool e, struct conncb *c); launch_data_t launchd_setstdio(int d, launch_data_t o); void launchd_SessionCreate(void); void launchd_shutdown(void); void launchd_single_user(void); +void launchd_post_kevent(void); pid_t launchd_fork(void); boolean_t launchd_mach_ipc_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply); -kern_return_t launchd_set_bport(mach_port_t name); -kern_return_t launchd_get_bport(mach_port_t *name); -kern_return_t launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which); -kern_return_t launchd_mport_notify_cancel(mach_port_t name, mach_msg_id_t which); -kern_return_t launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg); -kern_return_t launchd_mport_create_recv(mach_port_t *name); -kern_return_t launchd_mport_deallocate(mach_port_t name); -kern_return_t launchd_mport_make_send(mach_port_t name); -kern_return_t launchd_mport_close_recv(mach_port_t name); - void init_boot(bool sflag); void init_pre_kevent(void); @@ -84,12 +59,9 @@ void mach_start_shutdown(void); void mach_init_init(mach_port_t, mach_port_t, name_array_t, mach_port_array_t, mach_msg_type_number_t); -void mach_init_reap(void); int _fd(int fd); -void _log_launchd_bug(const char *rcs_rev, const char *path, unsigned int line, const char *test); - bool progeny_check(pid_t p); #endif Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -72,6 +72,7 @@ #include "launch.h" #include "launch_priv.h" #include "launchd.h" +#include "launchd_runtime.h" #include "launchd_core_logic.h" #include "launchd_unix_ipc.h" #include "bootstrap_private.h" @@ -1066,6 +1067,14 @@ bool is_wp = false; switch (key[0]) { + case 'l': + case 'L': + if (strcasecmp(key, LAUNCH_JOBKEY_LIMITLOADTOHOSTS) == 0) { + return; + } else if (strcasecmp(key, LAUNCH_JOBKEY_LIMITLOADFROMHOSTS) == 0) { + return; + } + break; case 'q': case 'Q': if (strcasecmp(key, LAUNCH_JOBKEY_QUEUEDIRECTORIES) == 0) { @@ -1229,6 +1238,35 @@ return NULL; } +static job_t +job_find_by_port2(job_t j, mach_port_t p) +{ + struct machservice *ms; + job_t jr, ji; + + if (j->bs_port == p) + return j; + + SLIST_FOREACH(ms, &j->machservices, sle) { + if (ms->port == p) + return j; + } + + SLIST_FOREACH(ji, &j->jobs, sle) { + if ((jr = job_find_by_port2(ji, p))) + return jr; + } + + errno = ESRCH; + return NULL; +} + +job_t +job_find_by_port(mach_port_t p) +{ + return job_find_by_port2(root_job, p); +} + void job_export_all2(job_t j, launch_data_t where) { Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -58,10 +57,9 @@ #include "bootstrap_private.h" #include "bootstrap.h" #include "bootstrapServer.h" -#include "notifyServer.h" #include "launchd_internal.h" -#include "launchd_internalServer.h" #include "launchd.h" +#include "launchd_runtime.h" #include "launchd_core_logic.h" #include "launch_priv.h" #include "launchd_unix_ipc.h" @@ -78,70 +76,22 @@ static au_asid_t inherited_asid = 0; static bool canReceive(mach_port_t); -static void init_ports(void); -static void *mport_demand_loop(void *arg); static void audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc); -static mach_port_t inherited_bootstrap_port = MACH_PORT_NULL; -static mach_port_t demand_port_set = MACH_PORT_NULL; -static size_t port_to_obj_size = 0; -static void **port_to_obj = NULL; -static pthread_t demand_thread; +mach_port_t inherited_bootstrap_port = MACH_PORT_NULL; static bool trusted_client_check(job_t j, struct ldcred *ldc); -job_t -job_find_by_port(mach_port_t mp) -{ - return port_to_obj[MACH_PORT_INDEX(mp)]; -} - -kern_return_t -x_handle_mport(mach_port_t junk __attribute__((unused))) -{ - mach_port_name_array_t members; - mach_msg_type_number_t membersCnt; - mach_port_status_t status; - mach_msg_type_number_t statusCnt; - struct kevent kev; - unsigned int i; - - if (!launchd_assumes(mach_port_get_set_status(mach_task_self(), demand_port_set, &members, &membersCnt) == KERN_SUCCESS)) - return 1; - - for (i = 0; i < membersCnt; i++) { - statusCnt = MACH_PORT_RECEIVE_STATUS_COUNT; - if (mach_port_get_attributes(mach_task_self(), members[i], MACH_PORT_RECEIVE_STATUS, - (mach_port_info_t)&status, &statusCnt) != KERN_SUCCESS) - continue; - - if (status.mps_msgcount) { - EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_find_by_port(members[i])); - (*((kq_callback *)kev.udata))(kev.udata, &kev); - /* the callback may have tainted our ability to continue this for loop */ - break; - } - } - - launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)members, - (vm_size_t) membersCnt * sizeof(mach_port_name_t)) == KERN_SUCCESS); - - return 0; -} - void mach_init_init(mach_port_t req_port, mach_port_t checkin_port, name_array_t l2l_names, mach_port_array_t l2l_ports, mach_msg_type_number_t l2l_cnt) { mach_msg_type_number_t l2l_i; auditinfo_t inherited_audit; - pthread_attr_t attr; getaudit(&inherited_audit); inherited_asid = inherited_audit.ai_asid; - init_ports(); - launchd_assert((root_job = job_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); launchd_assumes(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); @@ -152,14 +102,6 @@ /* We set this explicitly as we start each child */ launchd_assumes(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); - pthread_attr_init(&attr); - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); - - launchd_assert(pthread_create(&demand_thread, &attr, mport_demand_loop, NULL) == 0); - - pthread_attr_destroy(&attr); - /* cut off the Libc cache, we don't want to deadlock against ourself */ bootstrap_port = MACH_PORT_NULL; @@ -174,50 +116,6 @@ } } -void mach_init_reap(void) -{ - void *status; - - launchd_assumes(mach_port_destroy(mach_task_self(), demand_port_set) == KERN_SUCCESS); - - launchd_assumes(pthread_join(demand_thread, &status) == 0); -} - -void -init_ports(void) -{ - launchd_assert((errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, - &demand_port_set)) == KERN_SUCCESS); -} - -void * -mport_demand_loop(void *arg __attribute__((unused))) -{ - mach_msg_empty_rcv_t dummy; - kern_return_t kr; - - for (;;) { - kr = mach_msg(&dummy.header, MACH_RCV_MSG|MACH_RCV_LARGE, 0, 0, demand_port_set, 0, MACH_PORT_NULL); - if (kr == MACH_RCV_PORT_CHANGED) { - break; - } else if (!launchd_assumes(kr == MACH_RCV_TOO_LARGE)) { - continue; - } - launchd_assumes(handle_mport(launchd_internal_port) == 0); - } - - return NULL; -} - -boolean_t -launchd_mach_ipc_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) -{ - if (bootstrap_server_routine(Request)) - return bootstrap_server(Request, Reply); - - return notify_server(Request, Reply); -} - bool canReceive(mach_port_t port) { @@ -229,94 +127,6 @@ return ((p_type & MACH_PORT_TYPE_RECEIVE) != 0); } -kern_return_t -launchd_set_bport(mach_port_t name) -{ - return errno = task_set_bootstrap_port(mach_task_self(), name); -} - -kern_return_t -launchd_get_bport(mach_port_t *name) -{ - return errno = task_get_bootstrap_port(mach_task_self(), name); -} - -kern_return_t -launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which) -{ - mach_port_mscount_t msgc = (which == MACH_NOTIFY_NO_SENDERS) ? 1 : 0; - mach_port_t previous, where = (which == MACH_NOTIFY_NO_SENDERS) ? name : launchd_internal_port; - - if (which == MACH_NOTIFY_NO_SENDERS) { - /* Always make sure the send count is zero, in case a receive right is reused */ - errno = mach_port_set_mscount(mach_task_self(), name, 0); - if (errno != KERN_SUCCESS) - return errno; - } - - errno = mach_port_request_notification(mach_task_self(), name, which, msgc, where, - MACH_MSG_TYPE_MAKE_SEND_ONCE, &previous); - - if (errno == 0 && previous != MACH_PORT_NULL) - launchd_assumes(launchd_mport_deallocate(previous) == KERN_SUCCESS); - - return errno; -} - -kern_return_t -launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg) -{ - size_t needed_size; - - if (!obj) - return errno = mach_port_move_member(mach_task_self(), name, MACH_PORT_NULL); - - needed_size = (MACH_PORT_INDEX(name) + 1) * sizeof(void *); - - if (needed_size > port_to_obj_size) { - if (port_to_obj == NULL) { - launchd_assumes((port_to_obj = calloc(1, needed_size * 2)) != NULL); - } else { - launchd_assumes((port_to_obj = reallocf(port_to_obj, needed_size * 2)) != NULL); - memset((uint8_t *)port_to_obj + port_to_obj_size, 0, needed_size * 2 - port_to_obj_size); - } - port_to_obj_size = needed_size * 2; - } - - port_to_obj[MACH_PORT_INDEX(name)] = obj; - - return errno = mach_port_move_member(mach_task_self(), name, readmsg ? ipc_port_set : demand_port_set); -} - -kern_return_t -launchd_mport_make_send(mach_port_t name) -{ - return errno = mach_port_insert_right(mach_task_self(), name, name, MACH_MSG_TYPE_MAKE_SEND); -} - -kern_return_t -launchd_mport_close_recv(mach_port_t name) -{ - if (launchd_assumes(port_to_obj != NULL)) { - port_to_obj[MACH_PORT_INDEX(name)] = NULL; - return errno = mach_port_mod_refs(mach_task_self(), name, MACH_PORT_RIGHT_RECEIVE, -1); - } else { - return errno = KERN_FAILURE; - } -} - -kern_return_t -launchd_mport_create_recv(mach_port_t *name) -{ - return errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, name); -} - -kern_return_t -launchd_mport_deallocate(mach_port_t name) -{ - return errno = mach_port_deallocate(mach_task_self(), name); -} - void audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc) { @@ -810,81 +620,6 @@ return BOOTSTRAP_SUCCESS; } -kern_return_t -do_mach_notify_port_destroyed(mach_port_t notify, mach_port_t rights) -{ - /* This message is sent to us when a receive right is returned to us. */ - - if (!job_ack_port_destruction(root_job, rights)) { - launchd_assumes(launchd_mport_close_recv(rights) == KERN_SUCCESS); - } - - return KERN_SUCCESS; -} - -kern_return_t -do_mach_notify_port_deleted(mach_port_t notify, mach_port_name_t name) -{ - /* If we deallocate/destroy/mod_ref away a port with a pending notification, - * the original notification message is replaced with this message. - * - * To quote a Mach kernel expert, "the kernel has a send-once right that has - * to be used somehow." - */ - return KERN_SUCCESS; -} - -kern_return_t -do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) -{ - job_t j = job_find_by_port(notify); - - /* This message is sent to us when the last customer of one of our objects - * goes away. - */ - - if (!launchd_assumes(j != NULL)) - return KERN_FAILURE; - - job_ack_no_senders(j); - - return KERN_SUCCESS; -} - -kern_return_t -do_mach_notify_send_once(mach_port_t notify) -{ - /* - * This message is sent to us every time we close a port that we have - * outstanding Mach notification requests on. We can safely ignore - * this message. - */ - return KERN_SUCCESS; -} - -kern_return_t -do_mach_notify_dead_name(mach_port_t notify, mach_port_name_t name) -{ - /* This message is sent to us when one of our send rights no longer has - * a receiver somewhere else on the system. - */ - - if (name == inherited_bootstrap_port) { - launchd_assumes(launchd_mport_deallocate(name) == KERN_SUCCESS); - inherited_bootstrap_port = MACH_PORT_NULL; - } - - job_delete_anything_with_port(root_job, name); - - /* A dead-name notification about a port appears to increment the - * rights on said port. Let's deallocate it so that we don't leak - * dead-name ports. - */ - launchd_assumes(launchd_mport_deallocate(name) == KERN_SUCCESS); - - return KERN_SUCCESS; -} - bool trusted_client_check(job_t j, struct ldcred *ldc) { Copied: trunk/launchd/src/launchd_runtime.c (from rev 22841, trunk/launchd/src/launchd_mach_ipc.c) =================================================================== --- trunk/launchd/src/launchd_runtime.c (rev 0) +++ trunk/launchd/src/launchd_runtime.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -0,0 +1,404 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +static const char *const __rcs_file_version__ = "$Revision$"; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "launchd_runtime.h" + +#include "launchd_internalServer.h" +#include "launchd_internal.h" +#include "notifyServer.h" + +/* We shouldn't be including these */ +#include "launch.h" +#include "launchd.h" +#include "launchd_core_logic.h" +#include "bootstrapServer.h" + +static mach_port_t ipc_port_set = MACH_PORT_NULL; +static mach_port_t demand_port_set = MACH_PORT_NULL; +static mach_port_t launchd_internal_port = MACH_PORT_NULL; +static int mainkq = -1; +static int asynckq = -1; + +static pthread_t kqueue_demand_thread; +static pthread_t demand_thread;; + +static void *mport_demand_loop(void *arg); +static void *kqueue_demand_loop(void *arg); + +static void async_callback(void); +static kq_callback kqasync_callback = (kq_callback)async_callback; + +void +launchd_runtime_init(void) +{ + pthread_attr_t attr; + + launchd_assert((mainkq = kqueue()) != -1); + launchd_assert((asynckq = kqueue()) != -1); + + launchd_assert(kevent_mod(asynckq, EVFILT_READ, EV_ADD, 0, 0, &kqasync_callback) != -1); + + launchd_assert((errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &demand_port_set)) == KERN_SUCCESS); + launchd_assert((errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_PORT_SET, &ipc_port_set)) == KERN_SUCCESS); + + launchd_assert(launchd_mport_create_recv(&launchd_internal_port) == KERN_SUCCESS); + launchd_assert(launchd_mport_make_send(launchd_internal_port) == KERN_SUCCESS); + launchd_assert((errno = mach_port_move_member(mach_task_self(), launchd_internal_port, ipc_port_set)) == KERN_SUCCESS); + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); + launchd_assert(pthread_create(&kqueue_demand_thread, &attr, kqueue_demand_loop, NULL) == 0); + pthread_attr_destroy(&attr); + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); + launchd_assert(pthread_create(&demand_thread, &attr, mport_demand_loop, NULL) == 0); + pthread_attr_destroy(&attr); +} + +void * +mport_demand_loop(void *arg __attribute__((unused))) +{ + mach_msg_empty_rcv_t dummy; + kern_return_t kr; + + for (;;) { + kr = mach_msg(&dummy.header, MACH_RCV_MSG|MACH_RCV_LARGE, 0, 0, demand_port_set, 0, MACH_PORT_NULL); + if (kr == MACH_RCV_PORT_CHANGED) { + break; + } else if (!launchd_assumes(kr == MACH_RCV_TOO_LARGE)) { + continue; + } + launchd_assumes(handle_mport(launchd_internal_port) == 0); + } + + return NULL; +} + +kern_return_t +x_handle_mport(mach_port_t junk __attribute__((unused))) +{ + mach_port_name_array_t members; + mach_msg_type_number_t membersCnt; + mach_port_status_t status; + mach_msg_type_number_t statusCnt; + struct kevent kev; + unsigned int i; + + if (!launchd_assumes(mach_port_get_set_status(mach_task_self(), demand_port_set, &members, &membersCnt) == KERN_SUCCESS)) + return 1; + + for (i = 0; i < membersCnt; i++) { + statusCnt = MACH_PORT_RECEIVE_STATUS_COUNT; + if (mach_port_get_attributes(mach_task_self(), members[i], MACH_PORT_RECEIVE_STATUS, (mach_port_info_t)&status, + &statusCnt) != KERN_SUCCESS) { + continue; + } + if (status.mps_msgcount) { + EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_find_by_port(members[i])); + (*((kq_callback *)kev.udata))(kev.udata, &kev); + /* the callback may have tainted our ability to continue this for loop */ + break; + } + } + + launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)members, + (vm_size_t) membersCnt * sizeof(mach_port_name_t)) == KERN_SUCCESS); + + return 0; +} + +void * +kqueue_demand_loop(void *arg __attribute__((unused))) +{ + fd_set rfds; + + for (;;) { + FD_ZERO(&rfds); + FD_SET(mainkq, &rfds); + if (launchd_assumes(select(mainkq + 1, &rfds, NULL, NULL, NULL) == 1)) + launchd_assumes(handle_kqueue(launchd_internal_port, mainkq) == 0); + } + + return NULL; +} + +kern_return_t +x_handle_kqueue(mach_port_t junk __attribute__((unused)), integer_t fd) +{ + struct timespec ts = { 0, 0 }; + struct kevent kev; + int kevr; + + launchd_assumes((kevr = kevent(fd, NULL, 0, &kev, 1, &ts)) != -1); + + if (kevr == 1) + (*((kq_callback *)kev.udata))(kev.udata, &kev); + + launchd_post_kevent(); + + return 0; +} + + + +void +launchd_runtime(void) +{ + mach_msg_return_t msgr; + + for (;;) { + msgr = mach_msg_server(launchd_internal_demux, 10*1024, ipc_port_set, + MACH_RCV_LARGE | + MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) | + MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0)); + launchd_assumes(msgr == MACH_MSG_SUCCESS); + } +} + +kern_return_t +launchd_set_bport(mach_port_t name) +{ + return errno = task_set_bootstrap_port(mach_task_self(), name); +} + +kern_return_t +launchd_get_bport(mach_port_t *name) +{ + return errno = task_get_bootstrap_port(mach_task_self(), name); +} + +kern_return_t +launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which) +{ + mach_port_mscount_t msgc = (which == MACH_NOTIFY_NO_SENDERS) ? 1 : 0; + mach_port_t previous, where = (which == MACH_NOTIFY_NO_SENDERS) ? name : launchd_internal_port; + + if (which == MACH_NOTIFY_NO_SENDERS) { + /* Always make sure the send count is zero, in case a receive right is reused */ + errno = mach_port_set_mscount(mach_task_self(), name, 0); + if (errno != KERN_SUCCESS) + return errno; + } + + errno = mach_port_request_notification(mach_task_self(), name, which, msgc, where, + MACH_MSG_TYPE_MAKE_SEND_ONCE, &previous); + + if (errno == 0 && previous != MACH_PORT_NULL) + launchd_assumes(launchd_mport_deallocate(previous) == KERN_SUCCESS); + + return errno; +} + +kern_return_t +launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg) +{ + mach_port_t target_set = MACH_PORT_NULL; + + if (obj) { + target_set = readmsg ? ipc_port_set : demand_port_set; + } + + return errno = mach_port_move_member(mach_task_self(), name, target_set); +} + +kern_return_t +launchd_mport_make_send(mach_port_t name) +{ + return errno = mach_port_insert_right(mach_task_self(), name, name, MACH_MSG_TYPE_MAKE_SEND); +} + +kern_return_t +launchd_mport_close_recv(mach_port_t name) +{ + return errno = mach_port_mod_refs(mach_task_self(), name, MACH_PORT_RIGHT_RECEIVE, -1); +} + +kern_return_t +launchd_mport_create_recv(mach_port_t *name) +{ + return errno = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, name); +} + +kern_return_t +launchd_mport_deallocate(mach_port_t name) +{ + return errno = mach_port_deallocate(mach_task_self(), name); +} + +int +kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata) +{ + struct kevent kev; + int q = mainkq; + + if (EVFILT_TIMER == filter || EVFILT_VNODE == filter) + q = asynckq; + + if (flags & EV_ADD && !launchd_assumes(udata != NULL)) { + errno = EINVAL; + return -1; + } + + EV_SET(&kev, ident, filter, flags, fflags, data, udata); + + return kevent(q, &kev, 1, NULL, 0, NULL); +} + +void +async_callback(void) +{ + struct timespec timeout = { 0, 0 }; + struct kevent kev; + + if (launchd_assumes(kevent(asynckq, NULL, 0, &kev, 1, &timeout) == 1)) { + (*((kq_callback *)kev.udata))(kev.udata, &kev); + } +} + +void +runtime_force_on_demand(bool b) +{ + launchd_assumes(kevent_mod(asynckq, EVFILT_READ, b ? EV_DISABLE : EV_ENABLE, 0, 0, &kqasync_callback) != -1); +} + +boolean_t +launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) +{ + if (gc_this_job) { + job_remove(gc_this_job); + gc_this_job = NULL; + } + + if (Request->msgh_local_port == launchd_internal_port) { + if (launchd_internal_server_routine(Request)) + return launchd_internal_server(Request, Reply); + } else { + if (bootstrap_server_routine(Request)) + return bootstrap_server(Request, Reply); + } + + return notify_server(Request, Reply); +} + +kern_return_t +do_mach_notify_port_destroyed(mach_port_t notify, mach_port_t rights) +{ + /* This message is sent to us when a receive right is returned to us. */ + + if (!job_ack_port_destruction(root_job, rights)) { + launchd_assumes(launchd_mport_close_recv(rights) == KERN_SUCCESS); + } + + return KERN_SUCCESS; +} + +kern_return_t +do_mach_notify_port_deleted(mach_port_t notify, mach_port_name_t name) +{ + /* If we deallocate/destroy/mod_ref away a port with a pending + * notification, the original notification message is replaced with + * this message. To quote a Mach kernel expert, "the kernel has a + * send-once right that has to be used somehow." + */ + return KERN_SUCCESS; +} + +kern_return_t +do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) +{ + job_t j = job_find_by_port(notify); + + /* This message is sent to us when the last customer of one of our + * objects goes away. + */ + + if (!launchd_assumes(j != NULL)) + return KERN_FAILURE; + + job_ack_no_senders(j); + + return KERN_SUCCESS; +} + +kern_return_t +do_mach_notify_send_once(mach_port_t notify) +{ + /* This message is sent to us every time we close a port that we have + * outstanding Mach notification requests on. We can safely ignore this + * message. + */ + + return KERN_SUCCESS; +} + +kern_return_t +do_mach_notify_dead_name(mach_port_t notify, mach_port_name_t name) +{ + /* This message is sent to us when one of our send rights no longer has + * a receiver somewhere else on the system. + */ + + if (name == inherited_bootstrap_port) { + launchd_assumes(launchd_mport_deallocate(name) == KERN_SUCCESS); + inherited_bootstrap_port = MACH_PORT_NULL; + } + + job_delete_anything_with_port(root_job, name); + + /* A dead-name notification about a port appears to increment the + * rights on said port. Let's deallocate it so that we don't leak + * dead-name ports. + */ + launchd_assumes(launchd_mport_deallocate(name) == KERN_SUCCESS); + + return KERN_SUCCESS; +} Copied: trunk/launchd/src/launchd_runtime.h (from rev 22841, trunk/launchd/src/launchd.h) =================================================================== --- trunk/launchd/src/launchd_runtime.h (rev 0) +++ trunk/launchd/src/launchd_runtime.h 2006-09-11 21:08:28 UTC (rev 22850) @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2005 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ +#ifndef __LAUNCHD_RUNTIME_H__ +#define __LAUNCHD_RUNTIME_H__ + +#include + +/* + * Use launchd_assumes() when we can recover, even if it means we leak or limp along. + * + * Use launchd_assert() for core initialization routines. + */ +#define launchd_assumes(e) \ + (__builtin_expect(!(e), 0) ? _log_launchd_bug(__rcs_file_version__, __FILE__, __LINE__, #e), false : true) + +#define launchd_blame(e, b) \ + (__builtin_expect(!(e), 0) ? syslog(LOG_DEBUG, "Encountered bug: %d", b), false : true) + +#define launchd_assert(e) launchd_assumes(e) ? true : abort(); + +void _log_launchd_bug(const char *rcs_rev, const char *path, unsigned int line, const char *test); + +typedef void (*kq_callback)(void *, struct kevent *); + +boolean_t launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply); + +void launchd_runtime_init(void); +void launchd_runtime(void) __attribute__((noreturn)); + +void runtime_force_on_demand(bool); + +int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); + +kern_return_t launchd_set_bport(mach_port_t name); +kern_return_t launchd_get_bport(mach_port_t *name); +kern_return_t launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which); +kern_return_t launchd_mport_notify_cancel(mach_port_t name, mach_msg_id_t which); +kern_return_t launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg); +kern_return_t launchd_mport_create_recv(mach_port_t *name); +kern_return_t launchd_mport_deallocate(mach_port_t name); +kern_return_t launchd_mport_make_send(mach_port_t name); +kern_return_t launchd_mport_close_recv(mach_port_t name); + +#endif Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-08 16:26:14 UTC (rev 22849) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-11 21:08:28 UTC (rev 22850) @@ -48,6 +48,7 @@ #include "launch.h" #include "launch_priv.h" #include "launchd.h" +#include "launchd_runtime.h" #include "launchd_core_logic.h" #include "launchd_unix_ipc.h" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060911/672cd786/attachment.html From source_changes at macosforge.org Tue Sep 12 15:46:18 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22851] trunk/launchd/src Message-ID: <20060912224618.9605421EE883@cvs.opensource.apple.com> Revision: 22851 Author: zarzycki@apple.com Date: 2006-09-12 15:46:16 -0700 (Tue, 12 Sep 2006) Log Message: ----------- Part two of the new runtime system. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_runtime.c trunk/launchd/src/launchd_runtime.h Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-11 21:08:28 UTC (rev 22850) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-12 22:46:16 UTC (rev 22851) @@ -293,7 +293,7 @@ watchpath_ignore(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - job_assumes(j, launchd_mport_request_callback(ms->port, NULL, false) == KERN_SUCCESS); + job_assumes(j, runtime_remove_mport(ms->port) == KERN_SUCCESS); } void @@ -310,7 +310,7 @@ watchpath_watch(j, wp); SLIST_FOREACH(ms, &j->machservices, sle) - job_assumes(j, launchd_mport_request_callback(ms->port, j, false) == KERN_SUCCESS); + job_assumes(j, runtime_add_mport(ms->port, NULL, 0) == KERN_SUCCESS); } void @@ -572,10 +572,17 @@ bool job_setup_machport(job_t j) { + mach_msg_size_t mxmsgsz; + if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) goto out_bad; - if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ + mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); + if (x_bootstrap_subsystem.maxsize > mxmsgsz) + mxmsgsz = x_bootstrap_subsystem.maxsize; + + if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) goto out_bad2; return true; @@ -2641,6 +2648,7 @@ job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port) { char bslabel[1024] = "100000"; + mach_msg_size_t mxmsgsz; job_t j; if (requestorport == MACH_PORT_NULL) { @@ -2663,7 +2671,12 @@ sprintf(j->label, "%d", MACH_PORT_INDEX(j->bs_port)); - if (!job_assumes(j, launchd_mport_request_callback(j->bs_port, j, true) == KERN_SUCCESS)) + /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ + mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); + if (x_bootstrap_subsystem.maxsize > mxmsgsz) + mxmsgsz = x_bootstrap_subsystem.maxsize; + + if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) goto out_bad; if (p) { Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-11 21:08:28 UTC (rev 22850) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-12 22:46:16 UTC (rev 22851) @@ -57,7 +57,6 @@ #include "bootstrap_private.h" #include "bootstrap.h" #include "bootstrapServer.h" -#include "launchd_internal.h" #include "launchd.h" #include "launchd_runtime.h" #include "launchd_core_logic.h" @@ -448,7 +447,7 @@ *reqport = job_get_reqport(j); *rcvright = job_get_bsport(j); - launchd_assumes(launchd_mport_request_callback(*rcvright, NULL, true) == KERN_SUCCESS); + launchd_assumes(runtime_remove_mport(*rcvright) == KERN_SUCCESS); launchd_assumes(launchd_mport_make_send(*rcvright) == KERN_SUCCESS); Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-11 21:08:28 UTC (rev 22850) +++ trunk/launchd/src/launchd_runtime.c 2006-09-12 22:46:16 UTC (rev 22851) @@ -57,7 +57,6 @@ #include "launch.h" #include "launchd.h" #include "launchd_core_logic.h" -#include "bootstrapServer.h" static mach_port_t ipc_port_set = MACH_PORT_NULL; static mach_port_t demand_port_set = MACH_PORT_NULL; @@ -66,7 +65,7 @@ static int asynckq = -1; static pthread_t kqueue_demand_thread; -static pthread_t demand_thread;; +static pthread_t demand_thread; static void *mport_demand_loop(void *arg); static void *kqueue_demand_loop(void *arg); @@ -74,9 +73,17 @@ static void async_callback(void); static kq_callback kqasync_callback = (kq_callback)async_callback; +static void launchd_runtime2(mach_msg_size_t msg_size, mig_reply_error_t *bufRequest, mig_reply_error_t *bufReply); +static mach_msg_size_t max_msg_size; +static mig_callback *mig_cb_table; +static size_t mig_cb_table_sz; +static timeout_callback runtime_idle_callback; +static mach_msg_timeout_t runtime_idle_timeout; + void launchd_runtime_init(void) { + mach_msg_size_t mxmsgsz; pthread_attr_t attr; launchd_assert((mainkq = kqueue()) != -1); @@ -89,8 +96,14 @@ launchd_assert(launchd_mport_create_recv(&launchd_internal_port) == KERN_SUCCESS); launchd_assert(launchd_mport_make_send(launchd_internal_port) == KERN_SUCCESS); - launchd_assert((errno = mach_port_move_member(mach_task_self(), launchd_internal_port, ipc_port_set)) == KERN_SUCCESS); + /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ + mxmsgsz = sizeof(union __RequestUnion__x_launchd_internal_subsystem); + if (x_launchd_internal_subsystem.maxsize > mxmsgsz) + mxmsgsz = x_launchd_internal_subsystem.maxsize; + + launchd_assert(runtime_add_mport(launchd_internal_port, launchd_internal_demux, mxmsgsz) == KERN_SUCCESS); + pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); @@ -193,14 +206,33 @@ void launchd_runtime(void) { - mach_msg_return_t msgr; + mig_reply_error_t *req = NULL, *rep = NULL; + mach_msg_size_t mz = max_msg_size; + kern_return_t kr; for (;;) { - msgr = mach_msg_server(launchd_internal_demux, 10*1024, ipc_port_set, - MACH_RCV_LARGE | - MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) | - MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0)); - launchd_assumes(msgr == MACH_MSG_SUCCESS); + kr = vm_allocate(mach_task_self(), (vm_address_t *)&req, mz, VM_MAKE_TAG(VM_MEMORY_MACH_MSG)|TRUE); + if (!launchd_assumes(kr == KERN_SUCCESS)) { + goto free_path; + } + + kr = vm_allocate(mach_task_self(), (vm_address_t *)&rep, mz, VM_MAKE_TAG(VM_MEMORY_MACH_MSG)|TRUE); + if (!launchd_assumes(kr == KERN_SUCCESS)) { + goto free_path; + } + + /* max_msg_size might change, thus phase two... */ + launchd_runtime2(mz, req, rep); + +free_path: + if (req) { + launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)req, mz) == KERN_SUCCESS); + req = NULL; + } + if (rep) { + launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)rep, mz) == KERN_SUCCESS); + rep = NULL; + } } } @@ -238,19 +270,55 @@ return errno; } +void +runtime_set_timeout(timeout_callback to_cb, mach_msg_timeout_t to) +{ + if (to == 0 || to_cb == NULL) { + runtime_idle_callback = NULL; + runtime_idle_timeout = 0; + } + + runtime_idle_callback = to_cb; + runtime_idle_timeout = to; +} + kern_return_t -launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg) +runtime_add_mport(mach_port_t name, mig_callback demux, mach_msg_size_t msg_size) { - mach_port_t target_set = MACH_PORT_NULL; + size_t needed_table_sz = MACH_PORT_INDEX(name) * 2 * sizeof(mig_callback); + mach_port_t target_set = demux ? ipc_port_set : demand_port_set; - if (obj) { - target_set = readmsg ? ipc_port_set : demand_port_set; + msg_size = round_page(msg_size + MAX_TRAILER_SIZE); + + if (needed_table_sz > mig_cb_table_sz) { + mig_callback *new_table = malloc(needed_table_sz); + + if (!launchd_assumes(new_table != NULL)) + return KERN_RESOURCE_SHORTAGE; + + memcpy(new_table, mig_cb_table, mig_cb_table_sz); + memset(new_table + mig_cb_table_sz, 0, needed_table_sz - mig_cb_table_sz); + + mig_cb_table_sz = needed_table_sz; + mig_cb_table = new_table; } + mig_cb_table[MACH_PORT_INDEX(name)] = demux; + + if (msg_size > max_msg_size) { + max_msg_size = msg_size; + } + return errno = mach_port_move_member(mach_task_self(), name, target_set); } kern_return_t +runtime_remove_mport(mach_port_t name) +{ + return errno = mach_port_move_member(mach_task_self(), name, MACH_PORT_NULL); +} + +kern_return_t launchd_mport_make_send(mach_port_t name) { return errno = mach_port_insert_right(mach_task_self(), name, name, MACH_MSG_TYPE_MAKE_SEND); @@ -313,19 +381,10 @@ boolean_t launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply) { - if (gc_this_job) { - job_remove(gc_this_job); - gc_this_job = NULL; + if (launchd_internal_server_routine(Request)) { + return launchd_internal_server(Request, Reply); } - if (Request->msgh_local_port == launchd_internal_port) { - if (launchd_internal_server_routine(Request)) - return launchd_internal_server(Request, Reply); - } else { - if (bootstrap_server_routine(Request)) - return bootstrap_server(Request, Reply); - } - return notify_server(Request, Reply); } @@ -402,3 +461,105 @@ return KERN_SUCCESS; } + +void +launchd_runtime2(mach_msg_size_t msg_size, mig_reply_error_t *bufRequest, mig_reply_error_t *bufReply) +{ + mach_msg_options_t options, tmp_options; + mig_reply_error_t *bufTemp; + mig_callback the_demux; + mach_msg_timeout_t to; + mach_msg_return_t mr; + + options = MACH_RCV_MSG|MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) | + MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0); + + tmp_options = options; + + for (;;) { + to = MACH_MSG_TIMEOUT_NONE; + + if (msg_size != max_msg_size) { + /* The buffer isn't big enougth to receive messages anymore... */ + tmp_options &= ~MACH_RCV_MSG; + options &= ~MACH_RCV_MSG; + if (!(tmp_options & MACH_SEND_MSG)) { + return; + } + } + + if ((tmp_options & MACH_RCV_MSG) && runtime_idle_callback) { + tmp_options |= MACH_RCV_TIMEOUT; + + if (!(tmp_options & MACH_SEND_TIMEOUT)) { + to = runtime_idle_timeout; + } + } + + mr = mach_msg(&bufReply->Head, tmp_options, bufReply->Head.msgh_size, + msg_size, ipc_port_set, to, MACH_PORT_NULL); + + tmp_options = options; + + if (mr == MACH_SEND_INVALID_DEST || mr == MACH_SEND_TIMED_OUT) { + /* We need to clean up and start over. */ + if (bufReply->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX) { + mach_msg_destroy(&bufReply->Head); + } + continue; + } else if (mr == MACH_RCV_TIMED_OUT) { + if (to == MACH_MSG_TIMEOUT_NONE) { + continue; + } + runtime_idle_callback(); + } else if (!launchd_assumes(mr == MACH_MSG_SUCCESS)) { + continue; + } + + bufTemp = bufRequest; + bufRequest = bufReply; + bufReply = bufTemp; + + /* XXX - So very gross */ + if (gc_this_job) { + job_remove(gc_this_job); + gc_this_job = NULL; + } + + if (!(tmp_options & MACH_RCV_MSG)) { + continue; + } + + /* we have another request message */ + the_demux = mig_cb_table[MACH_PORT_INDEX(bufRequest->Head.msgh_local_port)]; + + if (!launchd_assumes(the_demux != NULL)) { + break; + } + + if (the_demux(&bufRequest->Head, &bufReply->Head) == FALSE) { + /* XXX - also gross */ + if (bufRequest->Head.msgh_id == MACH_NOTIFY_NO_SENDERS) { + notify_server(&bufRequest->Head, &bufReply->Head); + } + } + + if (!(bufReply->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) { + if (bufReply->RetCode == MIG_NO_REPLY) { + bufReply->Head.msgh_remote_port = MACH_PORT_NULL; + } else if ((bufReply->RetCode != KERN_SUCCESS) && (bufRequest->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)) { + /* destroy the request - but not the reply port */ + bufRequest->Head.msgh_remote_port = MACH_PORT_NULL; + mach_msg_destroy(&bufRequest->Head); + } + } + + if (bufReply->Head.msgh_remote_port != MACH_PORT_NULL) { + tmp_options |= MACH_SEND_MSG; + + if (MACH_MSGH_BITS_REMOTE(bufReply->Head.msgh_bits) != MACH_MSG_TYPE_MOVE_SEND_ONCE) { + tmp_options |= MACH_SEND_TIMEOUT; + } + } + } +} Modified: trunk/launchd/src/launchd_runtime.h =================================================================== --- trunk/launchd/src/launchd_runtime.h 2006-09-11 21:08:28 UTC (rev 22850) +++ trunk/launchd/src/launchd_runtime.h 2006-09-12 22:46:16 UTC (rev 22851) @@ -38,6 +38,8 @@ void _log_launchd_bug(const char *rcs_rev, const char *path, unsigned int line, const char *test); typedef void (*kq_callback)(void *, struct kevent *); +typedef boolean_t (*mig_callback)(mach_msg_header_t *, mach_msg_header_t *); +typedef void (*timeout_callback)(void); boolean_t launchd_internal_demux(mach_msg_header_t *Request, mach_msg_header_t *Reply); @@ -45,6 +47,9 @@ void launchd_runtime(void) __attribute__((noreturn)); void runtime_force_on_demand(bool); +void runtime_set_timeout(timeout_callback to_cb, mach_msg_timeout_t to); +kern_return_t runtime_add_mport(mach_port_t name, mig_callback demux, mach_msg_size_t msg_size); +kern_return_t runtime_remove_mport(mach_port_t name); int kevent_mod(uintptr_t ident, short filter, u_short flags, u_int fflags, intptr_t data, void *udata); @@ -52,7 +57,6 @@ kern_return_t launchd_get_bport(mach_port_t *name); kern_return_t launchd_mport_notify_req(mach_port_t name, mach_msg_id_t which); kern_return_t launchd_mport_notify_cancel(mach_port_t name, mach_msg_id_t which); -kern_return_t launchd_mport_request_callback(mach_port_t name, void *obj, bool readmsg); kern_return_t launchd_mport_create_recv(mach_port_t *name); kern_return_t launchd_mport_deallocate(mach_port_t name); kern_return_t launchd_mport_make_send(mach_port_t name); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060912/27a8c118/attachment.html From source_changes at macosforge.org Wed Sep 13 10:08:23 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22852] trunk/launchd/src/launchctl.c Message-ID: <20060913170823.A0C6521F0099@cvs.opensource.apple.com> Revision: 22852 Author: zarzycki@apple.com Date: 2006-09-13 10:08:21 -0700 (Wed, 13 Sep 2006) Log Message: ----------- Launchd should advertise (via bonjour) services with dynamic socket port assignments Modified Paths: -------------- trunk/launchd/src/launchctl.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-12 22:46:16 UTC (rev 22851) +++ trunk/launchd/src/launchctl.c 2006-09-13 17:08:21 UTC (rev 22852) @@ -863,6 +863,13 @@ fprintf(stderr, "bind(): %s\n", strerror(errno)); return; } + /* The kernel may have dynamically assigned some part of the + * address. (The port being a common example.) + */ + if (getsockname(sfd, res->ai_addr, &res->ai_addrlen) == -1) { + fprintf(stderr, "getsockname(): %s\n", strerror(errno)); + return; + } if (mgroup) { do_mgroup_join(sfd, res->ai_family, res->ai_socktype, res->ai_protocol, mgroup); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060913/df77cd53/attachment.html From source_changes at macosforge.org Thu Sep 14 16:05:17 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22853] trunk/launchd/src/launchd_runtime.c Message-ID: <20060914230517.6616E21F2BDE@cvs.opensource.apple.com> Revision: 22853 Author: zarzycki@apple.com Date: 2006-09-14 16:05:15 -0700 (Thu, 14 Sep 2006) Log Message: ----------- Fix a memory leak. Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-13 17:08:21 UTC (rev 22852) +++ trunk/launchd/src/launchd_runtime.c 2006-09-14 23:05:15 UTC (rev 22853) @@ -86,6 +86,8 @@ mach_msg_size_t mxmsgsz; pthread_attr_t attr; + launchd_assert((mig_cb_table = malloc(0)) != NULL); + launchd_assert((mainkq = kqueue()) != -1); launchd_assert((asynckq = kqueue()) != -1); @@ -299,6 +301,8 @@ memcpy(new_table, mig_cb_table, mig_cb_table_sz); memset(new_table + mig_cb_table_sz, 0, needed_table_sz - mig_cb_table_sz); + free(mig_cb_table); + mig_cb_table_sz = needed_table_sz; mig_cb_table = new_table; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060914/ebf71ce8/attachment.html From source_changes at macosforge.org Thu Sep 14 16:06:12 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22854] trunk/launchd/src/launch.h Message-ID: <20060914230612.DE54121F2C0B@cvs.opensource.apple.com> Revision: 22854 Author: zarzycki@apple.com Date: 2006-09-14 16:06:11 -0700 (Thu, 14 Sep 2006) Log Message: ----------- The "ServiceDescription" key has never been used. Modified Paths: -------------- trunk/launchd/src/launch.h Modified: trunk/launchd/src/launch.h =================================================================== --- trunk/launchd/src/launch.h 2006-09-14 23:05:15 UTC (rev 22853) +++ trunk/launchd/src/launch.h 2006-09-14 23:06:11 UTC (rev 22854) @@ -71,7 +71,6 @@ #define LAUNCH_JOBKEY_RUNATLOAD "RunAtLoad" #define LAUNCH_JOBKEY_ROOTDIRECTORY "RootDirectory" #define LAUNCH_JOBKEY_WORKINGDIRECTORY "WorkingDirectory" -#define LAUNCH_JOBKEY_SERVICEDESCRIPTION "ServiceDescription" #define LAUNCH_JOBKEY_ENVIRONMENTVARIABLES "EnvironmentVariables" #define LAUNCH_JOBKEY_USERENVIRONMENTVARIABLES "UserEnvironmentVariables" #define LAUNCH_JOBKEY_FORCEPOWERPC "ForcePowerPC" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060914/45972e32/attachment.html From source_changes at macosforge.org Thu Sep 14 17:41:48 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22855] trunk/launchd/src/launchd_runtime.c Message-ID: <20060915004148.4695A21F2F3C@cvs.opensource.apple.com> Revision: 22855 Author: zarzycki@apple.com Date: 2006-09-14 17:41:46 -0700 (Thu, 14 Sep 2006) Log Message: ----------- If a receive timeout happens, we always need to continue. Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-14 23:06:11 UTC (rev 22854) +++ trunk/launchd/src/launchd_runtime.c 2006-09-15 00:41:46 UTC (rev 22855) @@ -512,10 +512,10 @@ } continue; } else if (mr == MACH_RCV_TIMED_OUT) { - if (to == MACH_MSG_TIMEOUT_NONE) { - continue; + if (to != MACH_MSG_TIMEOUT_NONE) { + runtime_idle_callback(); } - runtime_idle_callback(); + continue; } else if (!launchd_assumes(mr == MACH_MSG_SUCCESS)) { continue; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060914/53e0ed2c/attachment.html From source_changes at macosforge.org Thu Sep 14 18:01:54 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22856] trunk/launchd/src/launchd_runtime.c Message-ID: <20060915010154.8F3DF21F2FE1@cvs.opensource.apple.com> Revision: 22856 Author: zarzycki@apple.com Date: 2006-09-14 18:01:52 -0700 (Thu, 14 Sep 2006) Log Message: ----------- Actually update the max message size before we enter the run loop again... Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-15 00:41:46 UTC (rev 22855) +++ trunk/launchd/src/launchd_runtime.c 2006-09-15 01:01:52 UTC (rev 22856) @@ -208,33 +208,32 @@ void launchd_runtime(void) { - mig_reply_error_t *req = NULL, *rep = NULL; + mig_reply_error_t *req = NULL, *resp = NULL; mach_msg_size_t mz = max_msg_size; - kern_return_t kr; + int flags = VM_MAKE_TAG(VM_MEMORY_MACH_MSG)|TRUE; for (;;) { - kr = vm_allocate(mach_task_self(), (vm_address_t *)&req, mz, VM_MAKE_TAG(VM_MEMORY_MACH_MSG)|TRUE); - if (!launchd_assumes(kr == KERN_SUCCESS)) { - goto free_path; + if (req) { + launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)req, mz) == KERN_SUCCESS); + req = NULL; } - - kr = vm_allocate(mach_task_self(), (vm_address_t *)&rep, mz, VM_MAKE_TAG(VM_MEMORY_MACH_MSG)|TRUE); - if (!launchd_assumes(kr == KERN_SUCCESS)) { - goto free_path; + if (resp) { + launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)resp, mz) == KERN_SUCCESS); + resp = NULL; } - /* max_msg_size might change, thus phase two... */ - launchd_runtime2(mz, req, rep); + mz = max_msg_size; -free_path: - if (req) { - launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)req, mz) == KERN_SUCCESS); - req = NULL; + if (!launchd_assumes(vm_allocate(mach_task_self(), (vm_address_t *)&req, mz, flags) == KERN_SUCCESS)) { + continue; } - if (rep) { - launchd_assumes(vm_deallocate(mach_task_self(), (vm_address_t)rep, mz) == KERN_SUCCESS); - rep = NULL; + if (!launchd_assumes(vm_allocate(mach_task_self(), (vm_address_t *)&resp, mz, flags) == KERN_SUCCESS)) { + continue; } + + launchd_runtime2(mz, req, resp); + + /* If we get here, max_msg_size probably changed... */ } } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060914/5c476e84/attachment.html From source_changes at macosforge.org Thu Sep 14 18:51:50 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22857] trunk/launchd/src/launchd_runtime.c Message-ID: <20060915015150.0464E21F314B@cvs.opensource.apple.com> Revision: 22857 Author: zarzycki@apple.com Date: 2006-09-14 18:51:47 -0700 (Thu, 14 Sep 2006) Log Message: ----------- Smarter memory management. Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-15 01:01:52 UTC (rev 22856) +++ trunk/launchd/src/launchd_runtime.c 2006-09-15 01:51:47 UTC (rev 22857) @@ -58,11 +58,11 @@ #include "launchd.h" #include "launchd_core_logic.h" -static mach_port_t ipc_port_set = MACH_PORT_NULL; -static mach_port_t demand_port_set = MACH_PORT_NULL; -static mach_port_t launchd_internal_port = MACH_PORT_NULL; -static int mainkq = -1; -static int asynckq = -1; +static mach_port_t ipc_port_set; +static mach_port_t demand_port_set; +static mach_port_t launchd_internal_port; +static int mainkq; +static int asynckq; static pthread_t kqueue_demand_thread; static pthread_t demand_thread; @@ -86,8 +86,6 @@ mach_msg_size_t mxmsgsz; pthread_attr_t attr; - launchd_assert((mig_cb_table = malloc(0)) != NULL); - launchd_assert((mainkq = kqueue()) != -1); launchd_assert((asynckq = kqueue()) != -1); @@ -286,22 +284,23 @@ kern_return_t runtime_add_mport(mach_port_t name, mig_callback demux, mach_msg_size_t msg_size) { - size_t needed_table_sz = MACH_PORT_INDEX(name) * 2 * sizeof(mig_callback); + size_t needed_table_sz = (MACH_PORT_INDEX(name) + 1) * sizeof(mig_callback); mach_port_t target_set = demux ? ipc_port_set : demand_port_set; msg_size = round_page(msg_size + MAX_TRAILER_SIZE); if (needed_table_sz > mig_cb_table_sz) { + needed_table_sz *= 2; /* Let's try and avoid realloc'ing for a while */ mig_callback *new_table = malloc(needed_table_sz); if (!launchd_assumes(new_table != NULL)) return KERN_RESOURCE_SHORTAGE; - memcpy(new_table, mig_cb_table, mig_cb_table_sz); - memset(new_table + mig_cb_table_sz, 0, needed_table_sz - mig_cb_table_sz); + if (mig_cb_table) { + memcpy(new_table, mig_cb_table, mig_cb_table_sz); + free(mig_cb_table); + } - free(mig_cb_table); - mig_cb_table_sz = needed_table_sz; mig_cb_table = new_table; } @@ -318,6 +317,8 @@ kern_return_t runtime_remove_mport(mach_port_t name) { + mig_cb_table[MACH_PORT_INDEX(name)] = NULL; + return errno = mach_port_move_member(mach_task_self(), name, MACH_PORT_NULL); } @@ -534,6 +535,11 @@ } /* we have another request message */ + + if (!launchd_assumes(mig_cb_table != NULL)) { + break; + } + the_demux = mig_cb_table[MACH_PORT_INDEX(bufRequest->Head.msgh_local_port)]; if (!launchd_assumes(the_demux != NULL)) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060914/d1a9cbef/attachment.html From source_changes at macosforge.org Mon Sep 18 10:22:02 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22858] trunk/launchd/src/launchctl.c Message-ID: <20060918172202.E82C72225FBF@cvs.opensource.apple.com> Revision: 22858 Author: zarzycki@apple.com Date: 2006-09-18 10:22:00 -0700 (Mon, 18 Sep 2006) Log Message: ----------- Now that the kernel tunes itself, we can delete this code. boot-up clean up: desiredvnodes should be auto-tuned like niobuf and nbuf Modified Paths: -------------- trunk/launchd/src/launchctl.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-15 01:51:47 UTC (rev 22857) +++ trunk/launchd/src/launchctl.c 2006-09-18 17:22:00 UTC (rev 22858) @@ -1159,12 +1159,7 @@ int bootstrap_cmd(int argc __attribute__((unused)), char *const argv[] __attribute__((unused))) { - int memmib[] = { CTL_HW, HW_MEMSIZE }; - int mvnmib[] = { CTL_KERN, KERN_MAXVNODES }; int hnmib[] = { CTL_KERN, KERN_HOSTNAME }; - uint64_t mem = 0; - uint32_t mvn; - size_t memsz = sizeof(mem); struct group *tfp_gr; if (assumes((tfp_gr = getgrnam("procview")) != NULL)) { @@ -1179,10 +1174,6 @@ assumes(sysctl(tfp_rw_mib, 3, NULL, NULL, &tfp_rw_gid, sizeof(tfp_rw_gid)) != -1); } - if (assumes(sysctl(memmib, 2, &mem, &memsz, NULL, 0) != -1)) { - mvn = mem / (64 * 1024) + 1024; - assumes(sysctl(mvnmib, 2, NULL, NULL, &mvn, sizeof(mvn)) != -1); - } assumes(sysctl(hnmib, 2, NULL, NULL, "localhost", sizeof("localhost")) != -1); loopback_setup_ipv4(); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060918/e9a206d2/attachment.html From source_changes at macosforge.org Tue Sep 19 10:48:48 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22859] tags/launchd-161/ Message-ID: <20060919174848.5E443222A306@cvs.opensource.apple.com> Revision: 22859 Author: zarzycki@apple.com Date: 2006-09-19 10:48:41 -0700 (Tue, 19 Sep 2006) Log Message: ----------- "Tagging launchd-161 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-161/ Copied: tags/launchd-161 (from rev 22858, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060919/8f52f25c/attachment.html From source_changes at macosforge.org Wed Sep 20 08:37:31 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22860] Message-ID: <20060920153731.34BDA130592@cvs.opensource.apple.com> Revision: 22860 Author: Date: Log Message: ----------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060920/cd0ddf63/attachment.html From source_changes at macosforge.org Wed Sep 20 11:54:00 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22860] Message-ID: <20060920185400.636281313C8@cvs.opensource.apple.com> Revision: 22860 http://trac.macosforge.org/projects/launchd/changeset/22860 Author: Date: Log Message: ----------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060920/078af57d/attachment.html From source_changes at macosforge.org Wed Sep 20 11:54:45 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22860] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060920185445.91A3E1313D7@cvs.opensource.apple.com> Revision: 22860 http://trac.macosforge.org/projects/launchd/changeset/22860 Author: zarzycki@apple.com Date: 2006-09-20 08:37:31 -0700 (Wed, 20 Sep 2006) Log Message: ----------- A fix for the AppleConnect hangs in recent Leopard builds Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-19 17:48:41 UTC (rev 22859) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-20 15:37:31 UTC (rev 22860) @@ -1469,7 +1469,7 @@ td = time(NULL) - j->start_time; - if (td < LAUNCHD_MIN_JOB_RUN_TIME) { + if (td < LAUNCHD_MIN_JOB_RUN_TIME && !j->legacy_mach_job) { time_t respawn_delta = LAUNCHD_MIN_JOB_RUN_TIME - td; job_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060920/0f275b67/attachment.html From source_changes at macosforge.org Wed Sep 20 13:29:48 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22861] tags/launchd-162/ Message-ID: <20060920202948.16F34131A6E@cvs.opensource.apple.com> Revision: 22861 http://trac.macosforge.org/projects/launchd/changeset/22861 Author: zarzycki@apple.com Date: 2006-09-20 13:29:47 -0700 (Wed, 20 Sep 2006) Log Message: ----------- "Tagging launchd-162 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-162/ Copied: tags/launchd-162 (from rev 22860, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060920/848d9001/attachment.html From source_changes at macosforge.org Thu Sep 21 10:43:19 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22862] trunk/launchd/src Message-ID: <20060921174319.01C6813982B@cvs.opensource.apple.com> Revision: 22862 http://trac.macosforge.org/projects/launchd/changeset/22862 Author: zarzycki@apple.com Date: 2006-09-21 10:43:19 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Let jobs override the default throttle interval Modified Paths: -------------- trunk/launchd/src/launch.h trunk/launchd/src/launchd.plist.5 trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h Modified: trunk/launchd/src/launch.h =================================================================== --- trunk/launchd/src/launch.h 2006-09-20 20:29:47 UTC (rev 22861) +++ trunk/launchd/src/launch.h 2006-09-21 17:43:19 UTC (rev 22862) @@ -92,6 +92,7 @@ #define LAUNCH_JOBKEY_LASTEXITSTATUS "LastExitStatus" #define LAUNCH_JOBKEY_PID "PID" #define LAUNCH_JOBKEY_SUBJOBS "SubJobs" +#define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInternval" #define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait" Modified: trunk/launchd/src/launchd.plist.5 =================================================================== --- trunk/launchd/src/launchd.plist.5 2006-09-20 20:29:47 UTC (rev 22861) +++ trunk/launchd/src/launchd.plist.5 2006-09-21 17:43:19 UTC (rev 22862) @@ -169,9 +169,15 @@ .Xr umask 2 before running the job. Known bug: Property lists don't support octal, so please convert the value to decimal. .It Sy TimeOut -The recommended time out (in seconds) to pass to the job. If no value is specified, a default time out will be supplied by +The recommended idle time out (in seconds) to pass to the job. If no value is specified, a default time out will be supplied by .Nm launchd for use by the job at check in time. +.It Sy ThrottleInternval +This key lets one override the default throttling policy imposed on jobs by +.Nm launchd . +The value is in seconds, and by default, jobs will not be spawned more than once every 10 seconds. +The principle behind this is that jobs should linger around just in case their needed again in the near future. This not only +reduces the latency of responses, but it encourages developers to amortize the cost of program invocation. .It Sy InitGroups This optional key specifies whether the job should have .Xr initgroups 3 Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-20 20:29:47 UTC (rev 22861) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-21 17:43:19 UTC (rev 22862) @@ -80,6 +80,8 @@ #include "bootstrapServer.h" #include "mpm_reply.h" +#define LAUNCHD_MIN_JOB_RUN_TIME 10 + struct machservice { SLIST_ENTRY(machservice) sle; job_t job; @@ -207,6 +209,7 @@ int nice; int timeout; time_t start_time; + time_t min_run_time; unsigned int start_interval; unsigned int checkedin:1, firstborn:1, debug:1, inetcompat:1, inetcompat_wait:1, ondemand:1, session_create:1, low_pri_io:1, no_init_groups:1, priv_port_has_senders:1, @@ -719,6 +722,7 @@ strcpy(j->label, label); j->kqjob_callback = job_callback; j->parent = p ? job_get_bs(p) : NULL; + j->min_run_time = LAUNCHD_MIN_JOB_RUN_TIME; j->ondemand = true; j->checkedin = true; j->firstborn = (strcmp(label, FIRSTBORN_LABEL) == 0); @@ -979,8 +983,15 @@ job_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); else j->timeout = value; + } else if (strcasecmp(key, LAUNCH_JOBKEY_THROTTLEINTERVAL) == 0) { + if (value < 0) { + job_log(j, LOG_WARNING, "%s less than zero. Ignoring.", LAUNCH_JOBKEY_THROTTLEINTERVAL); + } else { + j->min_run_time = value; + } } break; + break; case 'u': case 'U': if (strcasecmp(key, LAUNCH_JOBKEY_UMASK) == 0) { @@ -1469,8 +1480,8 @@ td = time(NULL) - j->start_time; - if (td < LAUNCHD_MIN_JOB_RUN_TIME && !j->legacy_mach_job) { - time_t respawn_delta = LAUNCHD_MIN_JOB_RUN_TIME - td; + if (td < j->min_run_time && !j->legacy_mach_job) { + time_t respawn_delta = j->min_run_time - td; job_log(j, LOG_WARNING, "Throttling respawn: Will start in %ld seconds", respawn_delta); job_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, respawn_delta, j) != -1); Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-20 20:29:47 UTC (rev 22861) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-21 17:43:19 UTC (rev 22862) @@ -20,8 +20,6 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -#define LAUNCHD_MIN_JOB_RUN_TIME 10 - #include "bootstrap_public.h" #define job_assumes(j, e) \ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/92c0e228/attachment.html From source_changes at macosforge.org Thu Sep 21 10:50:28 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22863] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060921175028.206B71398B2@cvs.opensource.apple.com> Revision: 22863 http://trac.macosforge.org/projects/launchd/changeset/22863 Author: zarzycki@apple.com Date: 2006-09-21 10:50:27 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Copy and paste typo. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-21 17:43:19 UTC (rev 22862) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-21 17:50:27 UTC (rev 22863) @@ -991,7 +991,6 @@ } } break; - break; case 'u': case 'U': if (strcasecmp(key, LAUNCH_JOBKEY_UMASK) == 0) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/913145d2/attachment.html From source_changes at macosforge.org Thu Sep 21 12:19:36 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22864] trunk/launchd/src Message-ID: <20060921191936.4B688139F90@cvs.opensource.apple.com> Revision: 22864 http://trac.macosforge.org/projects/launchd/changeset/22864 Author: zarzycki@apple.com Date: 2006-09-21 12:19:35 -0700 (Thu, 21 Sep 2006) Log Message: ----------- This hack makes it easier to debug shutdown related hangs caused by launchd jobs. Modified Paths: -------------- trunk/launchd/src/launchd.c trunk/launchd/src/launchd.h trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-21 17:50:27 UTC (rev 22863) +++ trunk/launchd/src/launchd.c 2006-09-21 19:19:35 UTC (rev 22864) @@ -104,6 +104,7 @@ sigset_t blocked_signals = 0; bool shutdown_in_progress = false; +bool debug_shutdown_hangs = false; bool network_up = false; int batch_disabler_count = 0; @@ -378,19 +379,24 @@ void launchd_shutdown(void) { + struct stat sb; + if (shutdown_in_progress) return; shutdown_in_progress = true; - runtime_force_on_demand(true); - + if (stat("/var/db/debugShutdownHangs", &sb) != -1) { + debug_shutdown_hangs = true; + } + rlcj = NULL; job_remove_all_inactive(root_job); - if (getpid() == 1) + if (getpid() == 1) { catatonia(); + } } void Modified: trunk/launchd/src/launchd.h =================================================================== --- trunk/launchd/src/launchd.h 2006-09-21 17:50:27 UTC (rev 22863) +++ trunk/launchd/src/launchd.h 2006-09-21 19:19:35 UTC (rev 22864) @@ -35,6 +35,7 @@ extern kq_callback kqsimple_zombie_reaper; extern sigset_t blocked_signals; extern bool shutdown_in_progress; +extern bool debug_shutdown_hangs; extern bool network_up; extern int batch_disabler_count; extern mach_port_t inherited_bootstrap_port; Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-21 17:50:27 UTC (rev 22863) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-21 19:19:35 UTC (rev 22864) @@ -236,6 +236,7 @@ static void job_setup_attributes(job_t j); static bool job_setup_machport(job_t j); static void job_postfork_become_user(job_t j); +static void job_force_sampletool(job_t j); static void job_callback(void *obj, struct kevent *kev); static pid_t job_fork(job_t j); static size_t job_prep_log_preface(job_t j, char *buf); @@ -433,8 +434,13 @@ if (!job_active(j)) { job_remove(j); - } else if (getpid() != 1) { - job_stop(j); + } else { + if (debug_shutdown_hangs) { + job_assumes(j, kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_ADD|EV_ONESHOT, NOTE_SECONDS, 8, j) != -1); + } + if (getpid() != 1) { + job_stop(j); + } } } @@ -539,7 +545,7 @@ free(j->stderrpath); if (j->start_interval) - kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_DELETE, 0, 0, NULL); + job_assumes(j, kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_DELETE, 0, 0, NULL); free(j); @@ -979,10 +985,11 @@ case 't': case 'T': if (strcasecmp(key, LAUNCH_JOBKEY_TIMEOUT) == 0) { - if (value <= 0) + if (value <= 0) { job_log(j, LOG_WARNING, "Timeout less than or equal to zero. Ignoring."); - else + } else { j->timeout = value; + } } else if (strcasecmp(key, LAUNCH_JOBKEY_THROTTLEINTERVAL) == 0) { if (value < 0) { job_log(j, LOG_WARNING, "%s less than zero. Ignoring.", LAUNCH_JOBKEY_THROTTLEINTERVAL); @@ -1001,12 +1008,14 @@ case 's': case 'S': if (strcasecmp(key, LAUNCH_JOBKEY_STARTINTERVAL) == 0) { - if (value <= 0) + if (value <= 0) { job_log(j, LOG_WARNING, "StartInterval is not greater than zero, ignoring"); - else + } else { j->start_interval = value; - if (-1 == kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, value, j)) + } + if (-1 == kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_ADD, NOTE_SECONDS, value, j)) { job_log_error(j, LOG_ERR, "adding kevent timer"); + } } break; default: @@ -1410,7 +1419,13 @@ } break; case EVFILT_TIMER: - if ((uintptr_t)j == kev->ident || (uintptr_t)&j->start_interval == kev->ident) { + if ((uintptr_t)j == kev->ident) { + if (j->p && job_assumes(j, debug_shutdown_hangs)) { + job_force_sampletool(j); + } else { + job_dispatch(j, true); + } + } else if ((uintptr_t)&j->start_interval == kev->ident) { job_dispatch(j, true); } else { calendarinterval_callback(j, kev); @@ -2962,6 +2977,27 @@ return j->p; } +void +job_force_sampletool(job_t j) +{ + char pidstr[100]; + pid_t sp; + + sprintf(pidstr, "%u", j->p); + + switch ((sp = fork())) { + case -1: + job_log_error(j, LOG_DEBUG, "Failed to spawn sample tool"); + break; + case 0: + job_assumes(j, execlp("sample", "sample", pidstr, "1", "-mayDie", NULL) != -1); + _exit(EXIT_FAILURE); + default: + job_assumes(j, kevent_mod(sp, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &kqsimple_zombie_reaper) != -1); + break; + } +} + bool semaphoreitem_new(job_t j, semaphore_reason_t why, const char *what) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/f4770dc9/attachment.html From source_changes at macosforge.org Thu Sep 21 12:37:43 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22865] trunk/launchd/src/launchd_runtime.c Message-ID: <20060921193743.E04F913A1AC@cvs.opensource.apple.com> Revision: 22865 http://trac.macosforge.org/projects/launchd/changeset/22865 Author: zarzycki@apple.com Date: 2006-09-21 12:37:43 -0700 (Thu, 21 Sep 2006) Log Message: ----------- This code is Disabled with an #if 0 statement. I'd rather not delete it because it may come in handy again. Modified Paths: -------------- trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-21 19:19:35 UTC (rev 22864) +++ trunk/launchd/src/launchd_runtime.c 2006-09-21 19:37:43 UTC (rev 22865) @@ -572,3 +572,87 @@ } } } + +#if 0 + +/* For ugly debug scenarios where syslogd is long gone (for example, during system shutdown). */ + +void +closelog(void) +{ +} + +void +openlog(const char *ident, int logopt, int facility) +{ + ident = 0; + logopt = 0; + facility = 0; +} + +int +setlogmask(int maskpri) +{ + return maskpri; +} + +void +syslog(int priority, const char *message, ...) +{ + va_list ap; + + va_start(ap, message); + + vsyslog(priority, message, ap); + + va_end(ap); +} + +void +vsyslog(int priority, const char *message, va_list args) +{ + static pthread_mutex_t ourlock = PTHREAD_MUTEX_INITIALIZER; + static FILE *ourlogfile = NULL; + int saved_errno = errno; + char newmsg[10000]; + size_t i, j; + + pthread_mutex_lock(&ourlock); + + if (ourlogfile == NULL) { + ourlogfile = fopen("/var/log/launchd_raw.log", "a"); + } + + pthread_mutex_unlock(&ourlock); + + if (ourlogfile == NULL) { + return; + } + + if (message == NULL) { + return; + } + + sprintf(newmsg, "p%u pp%u\t", getpid(), getppid()); + + for (i = 0, j = strlen(newmsg); message[i];) { + if (message[i] == '%' && message[i + 1] == 'm') { + char *errs = strerror(saved_errno); + strcpy(newmsg + j, errs ? errs : "unknown error"); + j += strlen(newmsg + j); + i += 2; + } else { + newmsg[j] = message[i]; + j++; + i++; + } + } + + strcpy(newmsg + j, "\n"); + + vfprintf(ourlogfile, newmsg, args); + + fflush(ourlogfile); +} + +#endif -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/dbd18c68/attachment.html From source_changes at macosforge.org Thu Sep 21 15:33:18 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:31 2007 Subject: [launchd-changes] [22866] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060921223318.3EB1B13B097@cvs.opensource.apple.com> Revision: 22866 http://trac.macosforge.org/projects/launchd/changeset/22866 Author: zarzycki@apple.com Date: 2006-09-21 15:33:17 -0700 (Thu, 21 Sep 2006) Log Message: ----------- launchd throttling is slowing down remote eppc connections Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-21 19:37:43 UTC (rev 22865) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-21 22:33:17 UTC (rev 22866) @@ -81,6 +81,7 @@ #include "mpm_reply.h" #define LAUNCHD_MIN_JOB_RUN_TIME 10 +#define LAUNCHD_ADVISABLE_IDLE_TIMEOUT 30 struct machservice { SLIST_ENTRY(machservice) sle; @@ -729,6 +730,7 @@ j->kqjob_callback = job_callback; j->parent = p ? job_get_bs(p) : NULL; j->min_run_time = LAUNCHD_MIN_JOB_RUN_TIME; + j->timeout = LAUNCHD_ADVISABLE_IDLE_TIMEOUT; j->ondemand = true; j->checkedin = true; j->firstborn = (strcmp(label, FIRSTBORN_LABEL) == 0); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/6998be77/attachment.html From source_changes at macosforge.org Thu Sep 21 15:58:34 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22867] trunk/launchd/src/launchd_mach_ipc.c Message-ID: <20060921225834.D60EA13B282@cvs.opensource.apple.com> Revision: 22867 http://trac.macosforge.org/projects/launchd/changeset/22867 Author: zarzycki@apple.com Date: 2006-09-21 15:58:34 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Let's nag more about bootstrap_register() being deprecated. Let's also trust that if one acquired a send right, it must be legit. Modified Paths: -------------- trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-21 22:33:17 UTC (rev 22866) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-21 22:58:34 UTC (rev 22867) @@ -213,8 +213,6 @@ audit_token_to_launchd_cred(au_tok, &ldc); - trusted_client_check(j, &ldc); - ms = job_lookup_service(j, servicename, true); if (ms == NULL) { @@ -252,7 +250,7 @@ audit_token_to_launchd_cred(au_tok, &ldc); - trusted_client_check(j, &ldc); + job_log(j, LOG_NOTICE, "bootstrap_register() is deprecated. PID: %u Service: %s", ldc.pid, servicename); job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); @@ -290,8 +288,6 @@ audit_token_to_launchd_cred(au_tok, &ldc); - trusted_client_check(j, &ldc); - ms = job_lookup_service(j, servicename, true); if (ms && machservice_hidden(ms) && !job_active(machservice_job(ms))) { -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060921/48d46f9e/attachment.html From source_changes at macosforge.org Fri Sep 22 08:56:05 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22868] trunk/launchd/src/launchctl.c Message-ID: <20060922155605.7069813EB9E@cvs.opensource.apple.com> Revision: 22868 http://trac.macosforge.org/projects/launchd/changeset/22868 Author: zarzycki@apple.com Date: 2006-09-22 08:56:05 -0700 (Fri, 22 Sep 2006) Log Message: ----------- /var/run/davlocks needs to be created by DAV Modified Paths: -------------- trunk/launchd/src/launchctl.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-21 22:58:34 UTC (rev 22867) +++ trunk/launchd/src/launchctl.c 2006-09-22 15:56:05 UTC (rev 22868) @@ -1217,7 +1217,6 @@ // XXX --> RMRF_ITEMS="/var/tmp/folders.* - // 775 www:www /var/run/davlocks 4489695 // 775 root:daemon /var/run/StartupItems assumes(touch_file(_PATH_UTMP, DEFFILEMODE) != -1); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060922/8aa1c637/attachment.html From source_changes at macosforge.org Fri Sep 22 14:51:34 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22869] tags/launchd-163/ Message-ID: <20060922215134.213E1140D2C@cvs.opensource.apple.com> Revision: 22869 http://trac.macosforge.org/projects/launchd/changeset/22869 Author: zarzycki@apple.com Date: 2006-09-22 14:51:33 -0700 (Fri, 22 Sep 2006) Log Message: ----------- "Tagging launchd-163 from https://svn.macosforge.org/repository/launchd/trunk" Added Paths: ----------- tags/launchd-163/ Copied: tags/launchd-163 (from rev 22868, trunk) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060922/3f596d38/attachment.html From source_changes at macosforge.org Sat Sep 23 10:09:21 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22870] trunk/launchd/src Message-ID: <20060923170921.5B6EB14E23F@cvs.opensource.apple.com> Revision: 22870 http://trac.macosforge.org/projects/launchd/changeset/22870 Author: zarzycki@apple.com Date: 2006-09-23 10:09:19 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Clean some other MIG generated files up. Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-22 21:51:33 UTC (rev 22869) +++ trunk/launchd/src/Makefile.am 2006-09-23 17:09:19 UTC (rev 22870) @@ -1,6 +1,8 @@ AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 -CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h +CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ + launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ + notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/bootstrap.defs mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/bootstrap.defs Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-22 21:51:33 UTC (rev 22869) +++ trunk/launchd/src/Makefile.in 2006-09-23 17:09:19 UTC (rev 22870) @@ -223,7 +223,10 @@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 -CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h +CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ + launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ + notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h + @LIBS_ONLY_TRUE@noinst_LIBRARIES = liblaunch.a liblaunch_profile.a @LIBS_ONLY_TRUE@liblaunch_a_SOURCES = liblaunch.c bootstrap_public.c @LIBS_ONLY_TRUE@liblaunch_profile_a_CFLAGS = -pg $(AM_CFLAGS) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/a598c5f9/attachment.html From source_changes at macosforge.org Sat Sep 23 10:43:35 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22871] trunk/launchd/src Message-ID: <20060923174335.3700814E750@cvs.opensource.apple.com> Revision: 22871 http://trac.macosforge.org/projects/launchd/changeset/22871 Author: zarzycki@apple.com Date: 2006-09-23 10:43:34 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Enable more warnings. Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-23 17:09:19 UTC (rev 22870) +++ trunk/launchd/src/Makefile.am 2006-09-23 17:43:34 UTC (rev 22871) @@ -1,4 +1,4 @@ -AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 +AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -Wextra -Waggregate-return -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-23 17:09:19 UTC (rev 22870) +++ trunk/launchd/src/Makefile.in 2006-09-23 17:43:34 UTC (rev 22871) @@ -222,7 +222,7 @@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -W -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 +AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -Wextra -Waggregate-return -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/016b1d9f/attachment.html From source_changes at macosforge.org Sat Sep 23 13:00:17 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22872] trunk/launchd/src Message-ID: <20060923200017.7083614F8EC@cvs.opensource.apple.com> Revision: 22872 http://trac.macosforge.org/projects/launchd/changeset/22872 Author: zarzycki@apple.com Date: 2006-09-23 13:00:16 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural and semantic reorganization: When possible, let's have the services created with bootstrap_register() associated with the job that created them rather than the bootstrap itself. This, in theory, could break things if the job is removed and it didn't own the receive right that it registered in the namespace, but in practice, I have not seen any evidence for this boundary condition being used. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-23 17:43:34 UTC (rev 22871) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-23 20:00:16 UTC (rev 22872) @@ -2843,7 +2843,7 @@ ms->isActive = true; - if (ms->job->req_port == MACH_PORT_NULL) { + if (ms->recv) { which = MACH_NOTIFY_PORT_DESTROYED; job_checkin(ms->job); } Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 17:43:34 UTC (rev 22871) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 20:00:16 UTC (rev 22872) @@ -269,7 +269,7 @@ } if (serviceport != MACH_PORT_NULL) { - if ((ms = machservice_new(job_get_bs(j), servicename, &serviceport))) { + if ((ms = machservice_new(j, servicename, &serviceport))) { machservice_watch(ms); } else { return BOOTSTRAP_NO_MEMORY; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/a3cd96a6/attachment.html From source_changes at macosforge.org Sat Sep 23 13:17:01 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22873] trunk/launchd/src/launchd_core_logic.c Message-ID: <20060923201701.C4B0B14FA86@cvs.opensource.apple.com> Revision: 22873 http://trac.macosforge.org/projects/launchd/changeset/22873 Author: zarzycki@apple.com Date: 2006-09-23 13:17:01 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural and semantic reorganization: Give all jobs a dedicated Mach port to represent those objects outside of launchd (a.k.a. "vproc_t"). Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-23 20:00:16 UTC (rev 22872) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-23 20:17:01 UTC (rev 22873) @@ -627,9 +627,6 @@ j->legacy_mach_job = true; j->priv_port_has_senders = true; /* the IPC that called us will make-send on this port */ - if (!job_setup_machport(j)) - goto out_bad; - if (!job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS)) { job_assumes(j, launchd_mport_close_recv(j->bs_port) == KERN_SUCCESS); goto out_bad; @@ -679,11 +676,6 @@ jr->stall_before_exec = w4d; jr->force_ppc = fppc; - if (!job_setup_machport(jr)) { - job_remove(jr); - return NULL; - } - if (workingdir) jr->workingdir = strdup(workingdir); @@ -723,8 +715,9 @@ j = calloc(1, sizeof(struct job_s) + strlen(label) + 1); - if (!job_assumes(p, j != NULL)) - goto out_bad; + if (!job_assumes(p, j != NULL)) { + return NULL; + } strcpy(j->label, label); j->kqjob_callback = job_callback; @@ -735,6 +728,10 @@ j->checkedin = true; j->firstborn = (strcmp(label, FIRSTBORN_LABEL) == 0); + if (!job_setup_machport(j)) { + goto out_bad; + } + if (reqport != MACH_PORT_NULL) { j->req_port = reqport; if (!job_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) @@ -783,13 +780,12 @@ return j; out_bad: - if (j) { - if (j->prog) - free(j->prog); - if (j->stdinpath) - free(j->stdinpath); - free(j); - } + if (j->prog) + free(j->prog); + if (j->stdinpath) + free(j->stdinpath); + free(j); + return NULL; } @@ -1079,8 +1075,6 @@ case 'M': if (strcasecmp(key, LAUNCH_JOBKEY_MACHSERVICES) == 0) { launch_data_dict_iterate(value, machservice_setup, j); - if (!SLIST_EMPTY(&j->machservices)) - job_setup_machport(j); } break; default: -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/2c46e158/attachment.html From source_changes at macosforge.org Sat Sep 23 13:25:10 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22874] trunk/launchd/src/launchd_mach_ipc.c Message-ID: <20060923202510.4B48114FB06@cvs.opensource.apple.com> Revision: 22874 http://trac.macosforge.org/projects/launchd/changeset/22874 Author: zarzycki@apple.com Date: 2006-09-23 13:25:10 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural and semantic reorganization: Some jobs, such as configd, are diligent about using bootstrap_unprivileged() before calling bootstrap_register(). Let's detect that and tie their calls to bootstrap_register() back to their job data structure. Note, this will become free once some future redesign work is done that will turn bootstrap_unprivileged() into a no-op. Modified Paths: -------------- trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 20:17:01 UTC (rev 22873) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 20:25:10 UTC (rev 22874) @@ -244,12 +244,18 @@ kern_return_t x_bootstrap_register(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { - job_t j = job_find_by_port(bp); + job_t j2, j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); + j2 = job_find_by_pid(root_job, ldc.pid); + + if (j2 && job_get_bs(j2) == j) { + j = j2; + } + job_log(j, LOG_NOTICE, "bootstrap_register() is deprecated. PID: %u Service: %s", ldc.pid, servicename); job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/c4e3d716/attachment.html From source_changes at macosforge.org Sat Sep 23 15:23:39 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22875] trunk/launchd/src Message-ID: <20060923222339.05DCC1502D7@cvs.opensource.apple.com> Revision: 22875 http://trac.macosforge.org/projects/launchd/changeset/22875 Author: zarzycki@apple.com Date: 2006-09-23 15:23:38 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural and semantic reorganization: The old privileged versus unprivileged bootstrap port was a messy and confusing concept. All jobs now run with what was known as an "unprivileged bootstrap port." Modified Paths: -------------- trunk/launchd/src/bootstrap.defs trunk/launchd/src/bootstrap_public.c trunk/launchd/src/bootstrap_public.h trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/bootstrap.defs =================================================================== --- trunk/launchd/src/bootstrap.defs 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/bootstrap.defs 2006-09-23 22:23:38 UTC (rev 22875) @@ -50,9 +50,7 @@ ServerAuditToken __token : audit_token_t; out __server_port : mach_port_make_send_t); -routine bootstrap_unprivileged( - __bs_port : mach_port_t; - out __unpriv_port : mach_port_make_send_t); +skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ routine bootstrap_check_in( __bs_port : mach_port_t; @@ -126,3 +124,9 @@ routine mpm_uncork_fork( __bs_port : mach_port_t; ServerAuditToken __token : audit_token_t); + +/* Essentially the inverse of bootstrap_unprivileged() */ +routine bootstrap_get_self( + __bs_port : mach_port_t; + ServerAuditToken __token : audit_token_t; + out __job_port : mach_port_make_send_t); Modified: trunk/launchd/src/bootstrap_public.c =================================================================== --- trunk/launchd/src/bootstrap_public.c 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/bootstrap_public.c 2006-09-23 22:23:38 UTC (rev 22875) @@ -34,6 +34,10 @@ #include #include +static mach_port_t vproc_self; + +static void vproc_get_self(void); + kern_return_t _launchd_to_launchd(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, name_array_t *service_names, mach_msg_type_number_t *service_namesCnt, @@ -160,7 +164,17 @@ kern_return_t bootstrap_unprivileged(mach_port_t bp, mach_port_t *unpriv_port) { - return raw_bootstrap_unprivileged(bp, unpriv_port); + kern_return_t kr; + + *unpriv_port = MACH_PORT_NULL; + + kr = mach_port_mod_refs(mach_task_self(), bp, MACH_PORT_RIGHT_SEND, 1); + + if (kr == KERN_SUCCESS) { + *unpriv_port = bp; + } + + return kr; } kern_return_t @@ -190,7 +204,13 @@ kern_return_t bootstrap_check_in(mach_port_t bp, name_t service_name, mach_port_t *sp) { - return raw_bootstrap_check_in(bp, service_name, sp); + if(bp != bootstrap_port) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + + vproc_get_self(); + + return raw_bootstrap_check_in(vproc_self, service_name, sp); } kern_return_t @@ -238,11 +258,6 @@ if (bootstrap_check_in(bp, service_name, &p) == BOOTSTRAP_SUCCESS) { mach_port_mod_refs(mach_task_self(), p, MACH_PORT_RIGHT_RECEIVE, -1); *service_active = BOOTSTRAP_STATUS_ON_DEMAND; - if (raw_bootstrap_unprivileged(bp, &p) == BOOTSTRAP_SUCCESS) { - if (bp == p) - *service_active = BOOTSTRAP_STATUS_INACTIVE; - mach_port_deallocate(mach_task_self(), p); - } return BOOTSTRAP_SUCCESS; } else if (bootstrap_look_up(bp, service_name, &p) == BOOTSTRAP_SUCCESS) { mach_port_deallocate(mach_task_self(), p); @@ -262,6 +277,23 @@ service_active, service_activeCnt); } + +void +vproc_get_self(void) +{ + mach_port_t bp_self; + + if (vproc_self != MACH_PORT_NULL) { + return; + } + + if (raw_bootstrap_get_self(bootstrap_port, &bp_self) != 0) { + return; + } + + vproc_self = bp_self; +} + const char * bootstrap_strerror(kern_return_t r) { Modified: trunk/launchd/src/bootstrap_public.h =================================================================== --- trunk/launchd/src/bootstrap_public.h 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/bootstrap_public.h 2006-09-23 22:23:38 UTC (rev 22875) @@ -196,7 +196,8 @@ */ kern_return_t bootstrap_unprivileged( mach_port_t bp, - mach_port_t *unpriv_port); + mach_port_t *unpriv_port) + AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5; /* * bootstrap_parent() Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-23 22:23:38 UTC (rev 22875) @@ -1244,16 +1244,20 @@ } job_t -job_find_by_pid(job_t j, pid_t p) +job_find_by_pid(job_t j, pid_t p, bool recurse) { job_t jr, ji; - if (j->p == p) + if (j->p == p) { return j; + } SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = job_find_by_pid(ji, p))) + if (ji->p == p) { + return ji; + } else if (recurse && (jr = job_find_by_pid(ji, p, recurse))) { return jr; + } } errno = ESRCH; @@ -1521,7 +1525,7 @@ job_assumes(j, launchd_mport_notify_req(j->bs_port, MACH_NOTIFY_NO_SENDERS) == KERN_SUCCESS); } - switch (c = job_fork(j->bs_port ? j : j->parent)) { + switch (c = job_fork(j->legacy_mach_job ? j : j->parent)) { case -1: job_log_error(j, LOG_ERR, "fork() failed, will try again in one second"); job_assumes(j, close(execspair[0]) == 0); Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-23 22:23:38 UTC (rev 22875) @@ -42,7 +42,7 @@ job_t job_find(job_t j, const char *label); -job_t job_find_by_pid(job_t j, pid_t p); +job_t job_find_by_pid(job_t j, pid_t p, bool recurse); job_t job_find_by_port(mach_port_t mp); job_t job_import(launch_data_t pload); launch_data_t job_import_bulk(launch_data_t pload); Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 20:25:10 UTC (rev 22874) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 22:23:38 UTC (rev 22875) @@ -189,16 +189,24 @@ } kern_return_t -x_bootstrap_unprivileged(mach_port_t bp, mach_port_t *unprivportp) +x_bootstrap_get_self(mach_port_t bp, audit_token_t au_tok, mach_port_t *unprivportp) { - job_t j = job_find_by_port(bp); + job_t j2, j = job_find_by_port(bp); + struct ldcred ldc; + audit_token_to_launchd_cred(au_tok, &ldc); + job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); - j = job_get_bs(j); + j2 = job_find_by_pid(j, ldc.pid, false); - *unprivportp = job_get_bsport(j); + if (!j2) { + job_log(j, LOG_NOTICE, "PID %u not managed by launchd", ldc.pid); + return BOOTSTRAP_NOT_PRIVILEGED; + } + *unprivportp = job_get_bsport(j2); + return BOOTSTRAP_SUCCESS; } @@ -250,7 +258,7 @@ audit_token_to_launchd_cred(au_tok, &ldc); - j2 = job_find_by_pid(root_job, ldc.pid); + j2 = job_find_by_pid(root_job, ldc.pid, true); if (j2 && job_get_bs(j2) == j) { j = j2; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/3f6a23c2/attachment.html From source_changes at macosforge.org Sat Sep 23 17:59:30 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22876] trunk/launchd/src Message-ID: <20060924005930.EDA9B150B31@cvs.opensource.apple.com> Revision: 22876 http://trac.macosforge.org/projects/launchd/changeset/22876 Author: zarzycki@apple.com Date: 2006-09-23 17:59:30 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural and semantic reorganization: This change is fairly large, but it gets things going in the right direction. About November/December of 2005, I noticed that Mach bootstraps and launchd jobs had a lot in common from a data structure perspective, so I merged them. Almost one year later, I'm thankful for the learning experience. Suffice it for me to say, they aren't the same. With this change, we now create "anonymous" jobs on the fly when the PID is not found in launchd's object graph. What this means, is we'll be able to easily undo the merger of the bootstrap and job data structures, but not go back to the mess I was trying to solve at the end of 2005. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-23 22:23:38 UTC (rev 22875) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 00:59:30 UTC (rev 22876) @@ -214,7 +214,7 @@ unsigned int start_interval; unsigned int checkedin:1, firstborn:1, debug:1, inetcompat:1, inetcompat_wait:1, ondemand:1, session_create:1, low_pri_io:1, no_init_groups:1, priv_port_has_senders:1, - importing_global_env:1, importing_hard_limits:1, setmask:1, legacy_mach_job:1, runatload:1, __pad0:1; + importing_global_env:1, importing_hard_limits:1, setmask:1, legacy_mach_job:1, runatload:1, anonymous:1; mode_t mask; unsigned int globargv:1, wait4debugger:1, transfer_bstrap:1, unload_at_exit:1, force_ppc:1, stall_before_exec:1, __pad:26; char label[0]; @@ -459,7 +459,7 @@ job_log(j, LOG_DEBUG, "Removed"); - if (j->p) { + if (j->p && !j->anonymous) { if (kevent_mod(j->p, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &kqsimple_zombie_reaper) == -1) { job_reap(j); } else { @@ -700,6 +700,36 @@ return jr; } +job_t +job_new_anonymous(job_t p, pid_t who) +{ + int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, who }; + char newlabel[1000], *procname = "unknown"; + struct kinfo_proc kp; + size_t kplen = sizeof(kp); + job_t jr; + + if (who) { + if (sysctl(mib, 4, &kp, &kplen, NULL, 0) == -1) { + return NULL; + } + procname = kp.kp_proc.p_comm; + } + + sprintf(newlabel, "anonymous-%u.%s", who, procname); + + jr = job_new(p, newlabel, procname, NULL, NULL, MACH_PORT_NULL); + + if (!jr) { + return NULL; + } + + jr->anonymous = true; + jr->p = who; + + return jr; +} + job_t job_new(job_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t reqport) { @@ -2648,25 +2678,30 @@ } void -job_foreach_service(job_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs) +job_foreach_service(job_t j, void (*bs_iter)(struct machservice *, void *), void *context, bool only_anonymous) { struct machservice *ms; job_t ji; j = job_get_bs(j); - if (include_subjobs) { - SLIST_FOREACH(ji, &j->jobs, sle) { - if (ji->req_port) - continue; + SLIST_FOREACH(ji, &j->jobs, sle) { + if (ji->req_port) { + continue; + } else if (only_anonymous && !ji->anonymous) { + continue; + } - SLIST_FOREACH(ms, &ji->machservices, sle) - bs_iter(ms, context); + SLIST_FOREACH(ms, &ji->machservices, sle) { + bs_iter(ms, context); } } - SLIST_FOREACH(ms, &j->machservices, sle) - bs_iter(ms, context); + if (!job_assumes(j, SLIST_EMPTY(&j->machservices))) { + SLIST_FOREACH(ms, &j->machservices, sle) { + bs_iter(ms, context); + } + } } job_t @@ -2737,18 +2772,22 @@ } SLIST_FOREACH_SAFE(ms, &j->machservices, sle, next_ms) { - if (ms->port == port) + if (ms->port == port) { machservice_delete(ms); + } } if (j->req_port == port) { if (j == root_job) { launchd_shutdown(); } else { - job_remove(j); + return job_remove(j); } } + if (j->anonymous && SLIST_EMPTY(&j->machservices)) { + job_remove(j); + } } struct machservice * Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-23 22:23:38 UTC (rev 22875) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-24 00:59:30 UTC (rev 22876) @@ -50,6 +50,7 @@ job_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); job_t job_new_via_mach_init(job_t jbs, const char *cmd, uid_t uid, bool ond); job_t job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port); +job_t job_new_anonymous(job_t p, pid_t who); launch_data_t job_export(job_t j); launch_data_t job_export_all(void); void job_dispatch(job_t j, bool kickstart); @@ -70,7 +71,7 @@ job_t job_parent(job_t j); void job_uncork_fork(job_t j); struct machservice *job_lookup_service(job_t jbs, const char *name, bool check_parent); -void job_foreach_service(job_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool include_subjobs); +void job_foreach_service(job_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool only_anonymous); void job_log(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-23 22:23:38 UTC (rev 22875) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 00:59:30 UTC (rev 22876) @@ -87,6 +87,7 @@ { mach_msg_type_number_t l2l_i; auditinfo_t inherited_audit; + job_t root_anon_job; getaudit(&inherited_audit); inherited_asid = inherited_audit.ai_asid; @@ -104,14 +105,18 @@ /* cut off the Libc cache, we don't want to deadlock against ourself */ bootstrap_port = MACH_PORT_NULL; - if (l2l_names == NULL) + if (l2l_names == NULL) { return; + } + launchd_assert(root_anon_job = job_new_anonymous(root_job, 0)); + for (l2l_i = 0; l2l_i < l2l_cnt; l2l_i++) { struct machservice *ms; - if ((ms = machservice_new(root_job, l2l_names[l2l_i], l2l_ports + l2l_i))) + if ((ms = machservice_new(root_anon_job, l2l_names[l2l_i], l2l_ports + l2l_i))) { machservice_watch(ms); + } } } @@ -201,8 +206,15 @@ j2 = job_find_by_pid(j, ldc.pid, false); if (!j2) { - job_log(j, LOG_NOTICE, "PID %u not managed by launchd", ldc.pid); - return BOOTSTRAP_NOT_PRIVILEGED; + if (ldc.uid == getuid() && ldc.euid == geteuid()) { + j2 = job_new_anonymous(j, ldc.pid); + if (!j2) { + return BOOTSTRAP_NO_MEMORY; + } + } else { + job_log(j, LOG_NOTICE, "PID %u not managed by launchd", ldc.pid); + return BOOTSTRAP_NOT_PRIVILEGED; + } } *unprivportp = job_get_bsport(j2); @@ -258,10 +270,14 @@ audit_token_to_launchd_cred(au_tok, &ldc); - j2 = job_find_by_pid(root_job, ldc.pid, true); - - if (j2 && job_get_bs(j2) == j) { - j = j2; + if (j == job_get_bs(j)) { + j2 = job_find_by_pid(j, ldc.pid, false); + if (!j2) { + j2 = job_new_anonymous(j, ldc.pid); + } + if (j2) { + j = j2; + } } job_log(j, LOG_NOTICE, "bootstrap_register() is deprecated. PID: %u Service: %s", ldc.pid, servicename); @@ -388,7 +404,7 @@ unsigned int cnt = 0; for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, true); + job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, false); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -399,7 +415,7 @@ goto out_bad; for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, true); + job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, false); launchd_assumes(info_resp.i == cnt); @@ -436,7 +452,7 @@ job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); - job_foreach_service(j, x_bootstrap_info_countservices, &cnt, false); + job_foreach_service(j, x_bootstrap_info_countservices, &cnt, true); result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); if (!launchd_assumes(result == KERN_SUCCESS)) @@ -446,7 +462,7 @@ if (!launchd_assumes(result == KERN_SUCCESS)) goto out_bad; - job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, false); + job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, true); launchd_assumes(info_resp.i == cnt); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/ad3be5fe/attachment.html From source_changes at macosforge.org Sat Sep 23 23:20:36 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22877] trunk/launchd/src Message-ID: <20060924062036.F3B77151ACF@cvs.opensource.apple.com> Revision: 22877 http://trac.macosforge.org/projects/launchd/changeset/22877 Author: zarzycki@apple.com Date: 2006-09-23 23:20:35 -0700 (Sat, 23 Sep 2006) Log Message: ----------- Structural reorganization: Okay. The "transfer sub-bootstrap" API is a necessary evil at the moment (sigh). Let's make sure anonymous jobs survive the transfer. We should be able to now undo the merger of bootstraps and jobs while at the same time being left with something cleaner than when we started. Modified Paths: -------------- trunk/launchd/src/bootstrap.defs trunk/launchd/src/bootstrap_private.h trunk/launchd/src/bootstrap_public.c trunk/launchd/src/launchd.c trunk/launchd/src/launchd.h trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/bootstrap.defs =================================================================== --- trunk/launchd/src/bootstrap.defs 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/bootstrap.defs 2006-09-24 06:20:35 UTC (rev 22877) @@ -98,6 +98,7 @@ out __bs_reqport : mach_port_t; out __bs_rcvright : mach_port_move_receive_t; out __service_names : name_array_t, dealloc; + out __service_pids : pointer_t, dealloc; out __service_ports : mach_port_array_t, dealloc); routine bootstrap_getsocket( Modified: trunk/launchd/src/bootstrap_private.h =================================================================== --- trunk/launchd/src/bootstrap_private.h 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/bootstrap_private.h 2006-09-24 06:20:35 UTC (rev 22877) @@ -30,6 +30,7 @@ kern_return_t _launchd_to_launchd(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, name_array_t *service_names, mach_msg_type_number_t *service_namesCnt, + vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, mach_port_array_t *ports, mach_msg_type_number_t *portCnt); kern_return_t bootstrap_getsocket(mach_port_t bp, name_t); Modified: trunk/launchd/src/bootstrap_public.c =================================================================== --- trunk/launchd/src/bootstrap_public.c 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/bootstrap_public.c 2006-09-24 06:20:35 UTC (rev 22877) @@ -41,9 +41,10 @@ kern_return_t _launchd_to_launchd(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, name_array_t *service_names, mach_msg_type_number_t *service_namesCnt, + vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, mach_port_array_t *ports, mach_msg_type_number_t *portCnt) { - return raw_bootstrap_transfer_subset(bp, reqport, rcvright, service_names, service_namesCnt, ports, portCnt); + return raw_bootstrap_transfer_subset(bp, reqport, rcvright, service_names, service_namesCnt, service_pids, service_pidsCnt, ports, portCnt); } pid_t Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/launchd.c 2006-09-24 06:20:35 UTC (rev 22877) @@ -117,7 +117,8 @@ SIGWINCH, SIGINFO, SIGUSR1, SIGUSR2 }; bool sflag = false, dflag = false, Dflag = false; - mach_msg_type_number_t l2l_name_cnt = 0, l2l_port_cnt = 0; + mach_msg_type_number_t l2l_name_cnt = 0, l2l_port_cnt = 0, l2l_pid_cnt = 0; + pid_t *l2l_pids = NULL; name_array_t l2l_names = NULL; mach_port_array_t l2l_ports = NULL; char ldconf[PATH_MAX] = PID1LAUNCHD_CONF; @@ -246,19 +247,31 @@ launchd_assert(bootstrap_parent(bootstrap_port, &newparent) == BOOTSTRAP_SUCCESS); launchd_assert(_launchd_to_launchd(bootstrap_port, &req_mport, &checkin_mport, - &l2l_names, &l2l_name_cnt, &l2l_ports, &l2l_port_cnt) == BOOTSTRAP_SUCCESS); + &l2l_names, &l2l_name_cnt, (vm_offset_t *)&l2l_pids, &l2l_pid_cnt, + &l2l_ports, &l2l_port_cnt) == BOOTSTRAP_SUCCESS); - launchd_assert(l2l_name_cnt == l2l_port_cnt); + launchd_assert(l2l_name_cnt == l2l_port_cnt && l2l_name_cnt == (l2l_pid_cnt / sizeof(pid_t))); task_set_bootstrap_port(mach_task_self(), newparent); launchd_assumes(mach_port_deallocate(mach_task_self(), bootstrap_port) == KERN_SUCCESS); bootstrap_port = newparent; } - mach_init_init(req_mport, checkin_mport, l2l_names, l2l_ports, l2l_name_cnt); + mach_init_init(req_mport, checkin_mport, l2l_names, l2l_ports, l2l_pids, l2l_name_cnt); - if (h) + if (l2l_names) { + mig_deallocate((vm_address_t)l2l_names, l2l_name_cnt * sizeof(l2l_names[0])); + } + if (l2l_ports) { + mig_deallocate((vm_address_t)l2l_ports, l2l_port_cnt * sizeof(l2l_ports[0])); + } + if (l2l_pids) { + mig_deallocate((vm_address_t)l2l_pids, l2l_pid_cnt); + } + + if (h) { sprintf(ldconf, "%s/%s", h, LAUNCHD_CONF); + } rlcj = job_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); launchd_assert(rlcj != NULL); Modified: trunk/launchd/src/launchd.h =================================================================== --- trunk/launchd/src/launchd.h 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/launchd.h 2006-09-24 06:20:35 UTC (rev 22877) @@ -59,7 +59,7 @@ void catatonia(void); void mach_start_shutdown(void); -void mach_init_init(mach_port_t, mach_port_t, name_array_t, mach_port_array_t, mach_msg_type_number_t); +void mach_init_init(mach_port_t, mach_port_t, name_array_t, mach_port_array_t, pid_t *, mach_msg_type_number_t); int _fd(int fd); Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 00:59:30 UTC (rev 22876) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 06:20:35 UTC (rev 22877) @@ -83,11 +83,11 @@ void mach_init_init(mach_port_t req_port, mach_port_t checkin_port, - name_array_t l2l_names, mach_port_array_t l2l_ports, mach_msg_type_number_t l2l_cnt) + name_array_t l2l_names, mach_port_array_t l2l_ports, pid_t *l2l_pids, mach_msg_type_number_t l2l_cnt) { mach_msg_type_number_t l2l_i; auditinfo_t inherited_audit; - job_t root_anon_job; + job_t anon_job; getaudit(&inherited_audit); inherited_asid = inherited_audit.ai_asid; @@ -109,12 +109,14 @@ return; } - launchd_assert(root_anon_job = job_new_anonymous(root_job, 0)); - for (l2l_i = 0; l2l_i < l2l_cnt; l2l_i++) { struct machservice *ms; - if ((ms = machservice_new(root_anon_job, l2l_names[l2l_i], l2l_ports + l2l_i))) { + if (!(anon_job = job_find_by_pid(root_job, l2l_pids[l2l_i], false))) { + launchd_assert(anon_job = job_new_anonymous(root_job, l2l_pids[l2l_i])); + } + + if ((ms = machservice_new(anon_job, l2l_names[l2l_i], &l2l_ports[l2l_i]))) { machservice_watch(ms); } } @@ -374,6 +376,7 @@ name_array_t service_names; bootstrap_status_array_t service_actives; mach_port_array_t ports; + pid_t *pids; unsigned int i; }; @@ -390,6 +393,7 @@ info_resp->service_actives[info_resp->i] = machservice_status(ms); } else { info_resp->ports[info_resp->i] = machservice_port(ms); + info_resp->pids[info_resp->i] = job_get_pid(machservice_job(ms)); } info_resp->i++; } @@ -398,20 +402,19 @@ x_bootstrap_info(mach_port_t bp, name_array_t *servicenamesp, unsigned int *servicenames_cnt, bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { - struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; + struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; job_t ji, j = job_find_by_port(bp); - kern_return_t result; unsigned int cnt = 0; for (ji = j; ji; ji = job_parent(ji)) job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, false); - result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); - if (!launchd_assumes(result == KERN_SUCCESS)) + mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (!launchd_assumes(info_resp.service_names != NULL)) goto out_bad; - result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0]), true); - if (!launchd_assumes(result == KERN_SUCCESS)) + mig_allocate((vm_address_t *)&info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); + if (!launchd_assumes(info_resp.service_actives != NULL)) goto out_bad; for (ji = j; ji; ji = job_parent(ji)) @@ -426,21 +429,25 @@ return BOOTSTRAP_SUCCESS; out_bad: - if (info_resp.service_names) - vm_deallocate(mach_task_self(), (vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (info_resp.service_names) { + mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + } + if (info_resp.service_actives) { + mig_deallocate((vm_address_t)info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); + } return BOOTSTRAP_NO_MEMORY; } kern_return_t x_bootstrap_transfer_subset(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, - name_array_t *servicenamesp, unsigned int *servicenames_cnt, - mach_port_array_t *ports, unsigned int *ports_cnt) + name_array_t *servicenamesp, unsigned int *servicenames_cnt, + vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, + mach_port_array_t *ports, unsigned int *ports_cnt) { - struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, 0 }; + struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; job_t j = job_find_by_port(bp); unsigned int cnt = 0; - kern_return_t result; if (getpid() != 1) { job_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); @@ -454,14 +461,18 @@ job_foreach_service(j, x_bootstrap_info_countservices, &cnt, true); - result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0]), true); - if (!launchd_assumes(result == KERN_SUCCESS)) + mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (!launchd_assumes(info_resp.service_names != NULL)) goto out_bad; - result = vm_allocate(mach_task_self(), (vm_address_t *)&info_resp.ports, cnt * sizeof(info_resp.ports[0]), true); - if (!launchd_assumes(result == KERN_SUCCESS)) + mig_allocate((vm_address_t *)&info_resp.ports, cnt * sizeof(info_resp.ports[0])); + if (!launchd_assumes(info_resp.ports != NULL)) goto out_bad; + mig_allocate((vm_address_t *)&info_resp.pids, cnt * sizeof(pid_t)); + if (!launchd_assumes(info_resp.pids != NULL)) + goto out_bad; + job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, true); launchd_assumes(info_resp.i == cnt); @@ -469,6 +480,8 @@ *servicenamesp = info_resp.service_names; *ports = info_resp.ports; *servicenames_cnt = *ports_cnt = cnt; + *service_pids = (vm_offset_t)info_resp.pids; + *service_pidsCnt = cnt * sizeof(pid_t); *reqport = job_get_reqport(j); *rcvright = job_get_bsport(j); @@ -480,8 +493,15 @@ return BOOTSTRAP_SUCCESS; out_bad: - if (info_resp.service_names) - vm_deallocate(mach_task_self(), (vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (info_resp.service_names) { + mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + } + if (info_resp.ports) { + mig_deallocate((vm_address_t)info_resp.ports, cnt * sizeof(info_resp.ports[0])); + } + if (info_resp.pids) { + mig_deallocate((vm_address_t)info_resp.pids, cnt * sizeof(pid_t)); + } return BOOTSTRAP_NO_MEMORY; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060923/e9f2a9ae/attachment.html From source_changes at macosforge.org Sun Sep 24 11:25:30 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22878] trunk/launchd/src Message-ID: <20060924182530.0721B154414@cvs.opensource.apple.com> Revision: 22878 http://trac.macosforge.org/projects/launchd/changeset/22878 Author: zarzycki@apple.com Date: 2006-09-24 11:25:30 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Kevin is right: Someday, every if/while block that didn't have {} will probably need them. Better to always have them than optimize for a silly presentation problem. On the plus side, it is less chaff is future diffs. Modified Paths: -------------- trunk/launchd/src/launchd.c trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_runtime.c trunk/launchd/src/launchd_unix_ipc.c Modified: trunk/launchd/src/launchd.c =================================================================== --- trunk/launchd/src/launchd.c 2006-09-24 06:20:35 UTC (rev 22877) +++ trunk/launchd/src/launchd.c 2006-09-24 18:25:30 UTC (rev 22878) @@ -220,12 +220,14 @@ /* main phase three: get the party started */ - if (dflag) + if (dflag) { launchd_assumes(daemon(0, 0) == 0); + } logopts = LOG_PID|LOG_CONS; - if (Dflag) + if (Dflag) { logopts |= LOG_PERROR; + } openlog(getprogname(), logopts, LOG_LAUNCHD); setlogmask(LOG_UPTO(Dflag ? LOG_DEBUG : LOG_NOTICE)); @@ -276,11 +278,13 @@ rlcj = job_new(root_job, READCONF_LABEL, LAUNCHCTL_PATH, NULL, ldconf, MACH_PORT_NULL); launchd_assert(rlcj != NULL); - if (argv[0]) + if (argv[0]) { fbj = job_new(root_job, FIRSTBORN_LABEL, NULL, (const char *const *)argv, NULL, MACH_PORT_NULL); + } - if (NULL == getenv("PATH")) + if (NULL == getenv("PATH")) { setenv("PATH", _PATH_STDPATH, 1); + } if (getpid() == 1) { pid1_magic_init(sflag); @@ -303,23 +307,28 @@ * configuration files. "Weee." */ - if (pp == 1) + if (pp == 1) { exit(EXIT_SUCCESS); + } ker = kevent_mod(pp, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &kqppidexit_callback); - if (ker == -1) + if (ker == -1) { exit(launchd_assumes(errno == ESRCH) ? EXIT_SUCCESS : EXIT_FAILURE); + } } - if (stat(ldconf, &sb) == 0) + if (stat(ldconf, &sb) == 0) { job_dispatch(rlcj, true); + } - if (fbj) + if (fbj) { job_dispatch(fbj, true); + } - if (getpid() == 1 && !job_active(rlcj)) + if (getpid() == 1 && !job_active(rlcj)) { init_pre_kevent(); + } launchd_assert(setjmp(doom_doom_doom) == 0); launchd_assumes(signal(SIGILL, fatal_signal_handler) != SIG_ERR); @@ -353,8 +362,9 @@ { const char *opts = "[-d]"; - if (getuid() == 0) + if (getuid() == 0) { opts = "[-d] [-S -U ]"; + } fprintf(where, "%s: %s [-- command [args ...]]\n", getprogname(), opts); @@ -366,15 +376,17 @@ fprintf(where, "\t-U Which user to create the session as.\n"); } - if (where == stdout) + if (where == stdout) { exit(EXIT_SUCCESS); + } } int _fd(int fd) { - if (fd >= 0) + if (fd >= 0) { launchd_assumes(fcntl(fd, F_SETFD, 1) != -1); + } return fd; } @@ -394,8 +406,9 @@ { struct stat sb; - if (shutdown_in_progress) + if (shutdown_in_progress) { return; + } shutdown_in_progress = true; @@ -423,8 +436,9 @@ for (tries = 0; tries < 10; tries++) { sleep(1); - if (kill(-1, 0) == -1 && errno == ESRCH) + if (kill(-1, 0) == -1 && errno == ESRCH) { goto out; + } } syslog(LOG_WARNING, "Gave up waiting for processes to exit while going to single user mode, sending SIGKILL"); @@ -440,8 +454,9 @@ switch (kev->ident) { case SIGHUP: - if (rlcj) + if (rlcj) { job_dispatch(rlcj, true); + } break; case SIGTERM: launchd_shutdown(); @@ -483,8 +498,9 @@ void *seclib; if (launchd_assumes((seclib = dlopen(SECURITY_LIB, RTLD_LAZY)) != NULL)) { - if (launchd_assumes((sescr = dlsym(seclib, "SessionCreate")) != NULL)) + if (launchd_assumes((sescr = dlsym(seclib, "SessionCreate")) != NULL)) { launchd_assumes(sescr(0, 0) == noErr); + } launchd_assumes(dlclose(seclib) != -1); } } @@ -514,10 +530,12 @@ if (launch_data_get_type(o) == LAUNCH_DATA_STRING) { char **where = &pending_stderr; - if (d == STDOUT_FILENO) + if (d == STDOUT_FILENO) { where = &pending_stdout; - if (*where) + } + if (*where) { free(*where); + } *where = strdup(launch_data_get_string(o)); } else if (launch_data_get_type(o) == LAUNCH_DATA_FD) { launchd_assumes(dup2(launch_data_get_fd(o), d) != -1); @@ -534,11 +552,13 @@ if (e && c->disabled_batch) { batch_disabler_count--; c->disabled_batch = 0; - if (batch_disabler_count == 0) + if (batch_disabler_count == 0) { runtime_force_on_demand(false); + } } else if (!e && !c->disabled_batch) { - if (batch_disabler_count == 0) + if (batch_disabler_count == 0) { runtime_force_on_demand(true); + } batch_disabler_count++; c->disabled_batch = 1; } @@ -550,16 +570,20 @@ struct ifaddrs *ifa, *ifai; bool up = false; - if (!launchd_assumes(getifaddrs(&ifa) != -1)) + if (!launchd_assumes(getifaddrs(&ifa) != -1)) { return network_up; + } for (ifai = ifa; ifai; ifai = ifai->ifa_next) { - if (!(ifai->ifa_flags & IFF_UP)) + if (!(ifai->ifa_flags & IFF_UP)) { continue; - if (ifai->ifa_flags & IFF_LOOPBACK) + } + if (ifai->ifa_flags & IFF_LOOPBACK) { continue; - if (ifai->ifa_addr->sa_family != AF_INET && ifai->ifa_addr->sa_family != AF_INET6) + } + if (ifai->ifa_addr->sa_family != AF_INET && ifai->ifa_addr->sa_family != AF_INET6) { continue; + } up = true; break; } @@ -577,8 +601,9 @@ network_up = get_network_state(); - if (!launchd_assumes(pfs != -1)) + if (!launchd_assumes(pfs != -1)) { return; + } memset(&kev_req, 0, sizeof(kev_req)); kev_req.vendor_code = KEV_VENDOR_APPLE; @@ -627,8 +652,9 @@ } else { strlcpy(buf, rcs_rev_tmp + 1, sizeof(buf)); rcs_rev_tmp = strchr(buf, ' '); - if (rcs_rev_tmp) + if (rcs_rev_tmp) { *rcs_rev_tmp = '\0'; + } } syslog(LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); @@ -645,16 +671,16 @@ struct kinfo_proc kp; size_t kplen = sizeof(kp); - if (launchd_assumes(sysctl(mib, miblen, &kp, &kplen, NULL, 0) != -1) - && launchd_assumes(kplen == sizeof(kp))) { + if (launchd_assumes(sysctl(mib, miblen, &kp, &kplen, NULL, 0) != -1) && launchd_assumes(kplen == sizeof(kp))) { p = kp.kp_eproc.e_ppid; } else { return false; } } - if (p == selfpid) + if (p == selfpid) { return true; + } return false; } @@ -673,8 +699,9 @@ } } if (getpid() == 1) { - if (rlcj && job_active(rlcj)) + if (rlcj && job_active(rlcj)) { return; + } init_pre_kevent(); } } Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 06:20:35 UTC (rev 22877) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 18:25:30 UTC (rev 22878) @@ -321,8 +321,9 @@ void job_stop(job_t j) { - if (j->p) + if (j->p) { kill(j->p, SIGTERM); + } } launch_data_t @@ -336,47 +337,50 @@ { launch_data_t tmp, tmp2, tmp3, r = launch_data_alloc(LAUNCH_DATA_DICTIONARY); - if (r == NULL) + if (r == NULL) { return NULL; + } - if ((tmp = launch_data_new_string(j->label))) + if ((tmp = launch_data_new_string(j->label))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_LABEL); - - if ((tmp = launch_data_new_bool(j->ondemand))) + } + if ((tmp = launch_data_new_bool(j->ondemand))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_ONDEMAND); - - if ((tmp = launch_data_new_integer(j->last_exit_status))) + } + if ((tmp = launch_data_new_integer(j->last_exit_status))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_LASTEXITSTATUS); - - if (j->p && (tmp = launch_data_new_integer(j->p))) + } + if (j->p && (tmp = launch_data_new_integer(j->p))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_PID); - - if ((tmp = launch_data_new_integer(j->timeout))) + } + if ((tmp = launch_data_new_integer(j->timeout))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_TIMEOUT); - - if (j->prog && (tmp = launch_data_new_string(j->prog))) + } + if (j->prog && (tmp = launch_data_new_string(j->prog))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_PROGRAM); - - if (j->stdoutpath && (tmp = launch_data_new_string(j->stdoutpath))) + } + if (j->stdoutpath && (tmp = launch_data_new_string(j->stdoutpath))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_STANDARDOUTPATH); - - if (j->stderrpath && (tmp = launch_data_new_string(j->stderrpath))) + } + if (j->stderrpath && (tmp = launch_data_new_string(j->stderrpath))) { launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_STANDARDERRORPATH); - + } if (j->argv && (tmp = launch_data_alloc(LAUNCH_DATA_ARRAY))) { int i; for (i = 0; i < j->argc; i++) { - if ((tmp2 = launch_data_new_string(j->argv[i]))) + if ((tmp2 = launch_data_new_string(j->argv[i]))) { launch_data_array_set_index(tmp, tmp2, i); + } } launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_PROGRAMARGUMENTS); } if (j->inetcompat && (tmp = launch_data_alloc(LAUNCH_DATA_DICTIONARY))) { - if ((tmp2 = launch_data_new_bool(j->inetcompat_wait))) + if ((tmp2 = launch_data_new_bool(j->inetcompat_wait))) { launch_data_dict_insert(tmp, tmp2, LAUNCH_JOBINETDCOMPATIBILITY_WAIT); + } launch_data_dict_insert(r, tmp, LAUNCH_JOBKEY_INETDCOMPATIBILITY); } @@ -387,8 +391,9 @@ SLIST_FOREACH(sg, &j->sockets, sle) { if ((tmp2 = launch_data_alloc(LAUNCH_DATA_ARRAY))) { for (i = 0; i < sg->fd_cnt; i++) { - if ((tmp3 = launch_data_new_fd(sg->fds[i]))) + if ((tmp3 = launch_data_new_fd(sg->fds[i]))) { launch_data_array_set_index(tmp2, tmp3, i); + } } launch_data_dict_insert(tmp, tmp2, sg->name); } @@ -469,11 +474,13 @@ } } - if (j->parent) + if (j->parent) { SLIST_REMOVE(&j->parent->jobs, j, job_s, sle); + } - if (j->execfd) + if (j->execfd) { job_assumes(j, close(j->execfd) == 0); + } if (j->bs_port) { if (j->transfer_bstrap) { @@ -483,70 +490,73 @@ } } - if (j->req_port) + if (j->req_port) { job_assumes(j, launchd_mport_deallocate(j->req_port) == KERN_SUCCESS); + } #if 0 if (j->wait_reply_port) { } #endif - while ((ji = SLIST_FIRST(&j->jobs))) + while ((ji = SLIST_FIRST(&j->jobs))) { job_remove(ji); - - while ((sg = SLIST_FIRST(&j->sockets))) + } + while ((sg = SLIST_FIRST(&j->sockets))) { socketgroup_delete(j, sg); - - while ((wp = SLIST_FIRST(&j->vnodes))) + } + while ((wp = SLIST_FIRST(&j->vnodes))) { watchpath_delete(j, wp); - - while ((ci = SLIST_FIRST(&j->cal_intervals))) + } + while ((ci = SLIST_FIRST(&j->cal_intervals))) { calendarinterval_delete(j, ci); - - while ((ei = SLIST_FIRST(&j->env))) + } + while ((ei = SLIST_FIRST(&j->env))) { envitem_delete(j, ei, false); - - while ((ei = SLIST_FIRST(&j->global_env))) + } + while ((ei = SLIST_FIRST(&j->global_env))) { envitem_delete(j, ei, true); - - while ((li = SLIST_FIRST(&j->limits))) + } + while ((li = SLIST_FIRST(&j->limits))) { limititem_delete(j, li); - - while ((ms = SLIST_FIRST(&j->machservices))) + } + while ((ms = SLIST_FIRST(&j->machservices))) { machservice_delete(ms); - - while ((si = SLIST_FIRST(&j->semaphores))) + } + while ((si = SLIST_FIRST(&j->semaphores))) { semaphoreitem_delete(j, si); + } - if (j->prog) + if (j->prog) { free(j->prog); - - if (j->argv) + } + if (j->argv) { free(j->argv); - - if (j->rootdir) + } + if (j->rootdir) { free(j->rootdir); - - if (j->workingdir) + } + if (j->workingdir) { free(j->workingdir); - - if (j->username) + } + if (j->username) { free(j->username); - - if (j->groupname) + } + if (j->groupname) { free(j->groupname); - - if (j->stdinpath) + } + if (j->stdinpath) { free(j->stdinpath); - - if (j->stdoutpath) + } + if (j->stdoutpath) { free(j->stdoutpath); - - if (j->stderrpath) + } + if (j->stderrpath) { free(j->stderrpath); - - if (j->start_interval) + } + if (j->start_interval) { job_assumes(j, kevent_mod((uintptr_t)&j->start_interval, EVFILT_TIMER, EV_DELETE, 0, 0, NULL) != -1); + } kevent_mod((uintptr_t)j, EVFILT_TIMER, EV_DELETE, 0, 0, NULL); free(j); @@ -560,16 +570,18 @@ unsigned int i, fd_cnt = 1; int *fds; - if (launch_data_get_type(obj) == LAUNCH_DATA_ARRAY) + if (launch_data_get_type(obj) == LAUNCH_DATA_ARRAY) { fd_cnt = launch_data_array_get_count(obj); + } fds = alloca(fd_cnt * sizeof(int)); for (i = 0; i < fd_cnt; i++) { - if (launch_data_get_type(obj) == LAUNCH_DATA_ARRAY) + if (launch_data_get_type(obj) == LAUNCH_DATA_ARRAY) { tmp_oai = launch_data_array_get_index(obj, i); - else + } else { tmp_oai = obj; + } fds[i] = launch_data_get_fd(tmp_oai); } @@ -584,16 +596,19 @@ { mach_msg_size_t mxmsgsz; - if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_create_recv(&j->bs_port) == KERN_SUCCESS)) { goto out_bad; + } /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); - if (x_bootstrap_subsystem.maxsize > mxmsgsz) + if (x_bootstrap_subsystem.maxsize > mxmsgsz) { mxmsgsz = x_bootstrap_subsystem.maxsize; + } - if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) + if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) { goto out_bad2; + } return true; out_bad2: @@ -609,8 +624,9 @@ job_t j = NULL; char buf[1000]; - if (!job_assumes(jbs, argv != NULL)) + if (!job_assumes(jbs, argv != NULL)) { goto out_bad; + } /* preflight the string so we know how big it is */ sprintf(buf, "100000.%s", basename((char *)argv[0])); @@ -619,8 +635,9 @@ free(argv); - if (!job_assumes(jbs, j != NULL)) + if (!job_assumes(jbs, j != NULL)) { goto out_bad; + } j->mach_uid = uid; j->ondemand = ond; @@ -639,8 +656,9 @@ return j; out_bad: - if (j) + if (j) { job_remove(j); + } return NULL; } @@ -669,15 +687,17 @@ jr = job_new(root_job, label, path, argv, NULL, MACH_PORT_NULL); - if (!jr) + if (!jr) { return NULL; + } jr->unload_at_exit = true; jr->stall_before_exec = w4d; jr->force_ppc = fppc; - if (workingdir) + if (workingdir) { jr->workingdir = strdup(workingdir); + } if (u_mask) { jr->mask = *u_mask; @@ -764,20 +784,23 @@ if (reqport != MACH_PORT_NULL) { j->req_port = reqport; - if (!job_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_notify_req(reqport, MACH_NOTIFY_DEAD_NAME) == KERN_SUCCESS)) { goto out_bad; + } } if (prog) { j->prog = strdup(prog); - if (!job_assumes(j, j->prog != NULL)) + if (!job_assumes(j, j->prog != NULL)) { goto out_bad; + } } if (stdinpath) { j->stdinpath = strdup(stdinpath); - if (!job_assumes(j, j->stdinpath != NULL)) + if (!job_assumes(j, j->stdinpath != NULL)) { goto out_bad; + } } if (argv) { @@ -789,8 +812,9 @@ j->argv = malloc((j->argc + 1) * sizeof(char *) + cc); - if (!job_assumes(j, j->argv != NULL)) + if (!job_assumes(j, j->argv != NULL)) { goto out_bad; + } co = ((char *)j->argv) + ((j->argc + 1) * sizeof(char *)); @@ -810,10 +834,12 @@ return j; out_bad: - if (j->prog) + if (j->prog) { free(j->prog); - if (j->stdinpath) + } + if (j->stdinpath) { free(j->stdinpath); + } free(j); return NULL; @@ -824,8 +850,9 @@ { job_t j = job_import2(pload); - if (j == NULL) + if (j == NULL) { return NULL; + } job_dispatch(j, false); @@ -842,14 +869,16 @@ ja = alloca(c * sizeof(job_t )); for (i = 0; i < c; i++) { - if ((ja[i] = job_import2(launch_data_array_get_index(pload, i)))) + if ((ja[i] = job_import2(launch_data_array_get_index(pload, i)))) { errno = 0; + } launch_data_array_set_index(resp, launch_data_new_errno(errno), i); } for (i = 0; i < c; i++) { - if (ja[i] == NULL) + if (ja[i] == NULL) { continue; + } job_dispatch(ja[i], false); } @@ -862,33 +891,39 @@ switch (key[0]) { case 'f': case 'F': - if (strcasecmp(key, LAUNCH_JOBKEY_FORCEPOWERPC) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_FORCEPOWERPC) == 0) { j->force_ppc = value; + } break; case 'k': case 'K': - if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE) == 0) { j->ondemand = !value; + } break; case 'o': case 'O': - if (strcasecmp(key, LAUNCH_JOBKEY_ONDEMAND) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_ONDEMAND) == 0) { j->ondemand = value; + } break; case 'd': case 'D': - if (strcasecmp(key, LAUNCH_JOBKEY_DEBUG) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_DEBUG) == 0) { j->debug = value; + } break; case 's': case 'S': - if (strcasecmp(key, LAUNCH_JOBKEY_SESSIONCREATE) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_SESSIONCREATE) == 0) { j->session_create = value; + } break; case 'l': case 'L': - if (strcasecmp(key, LAUNCH_JOBKEY_LOWPRIORITYIO) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_LOWPRIORITYIO) == 0) { j->low_pri_io = value; + } break; case 'i': case 'I': @@ -902,18 +937,21 @@ break; case 'r': case 'R': - if (strcasecmp(key, LAUNCH_JOBKEY_RUNATLOAD) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_RUNATLOAD) == 0) { j->runatload = value; + } break; case 'e': case 'E': - if (strcasecmp(key, LAUNCH_JOBKEY_ENABLEGLOBBING) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_ENABLEGLOBBING) == 0) { j->globargv = value; + } break; case 'w': case 'W': - if (strcasecmp(key, LAUNCH_JOBKEY_WAITFORDEBUGGER) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_WAITFORDEBUGGER) == 0) { j->wait4debugger = value; + } break; default: break; @@ -928,8 +966,9 @@ switch (key[0]) { case 'p': case 'P': - if (strcasecmp(key, LAUNCH_JOBKEY_PROGRAM) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_PROGRAM) == 0) { return; + } break; case 'l': case 'L': @@ -955,8 +994,9 @@ break; case 'w': case 'W': - if (strcasecmp(key, LAUNCH_JOBKEY_WORKINGDIRECTORY) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_WORKINGDIRECTORY) == 0) { where2put = &j->workingdir; + } break; case 'u': case 'U': @@ -1007,8 +1047,9 @@ switch (key[0]) { case 'n': case 'N': - if (strcasecmp(key, LAUNCH_JOBKEY_NICE) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_NICE) == 0) { j->nice = value; + } break; case 't': case 'T': @@ -1059,21 +1100,24 @@ switch (key[0]) { case 'k': case 'K': - if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_KEEPALIVE) == 0) { launch_data_dict_iterate(value, semaphoreitem_setup, j); + } break; case 'i': case 'I': if (strcasecmp(key, LAUNCH_JOBKEY_INETDCOMPATIBILITY) == 0) { j->inetcompat = true; - if ((tmp = launch_data_dict_lookup(value, LAUNCH_JOBINETDCOMPATIBILITY_WAIT))) + if ((tmp = launch_data_dict_lookup(value, LAUNCH_JOBINETDCOMPATIBILITY_WAIT))) { j->inetcompat_wait = launch_data_get_bool(tmp); + } } break; case 'e': case 'E': - if (strcasecmp(key, LAUNCH_JOBKEY_ENVIRONMENTVARIABLES) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_ENVIRONMENTVARIABLES) == 0) { launch_data_dict_iterate(value, envitem_setup, j); + } break; case 'u': case 'U': @@ -1136,13 +1180,15 @@ break; case 'w': case 'W': - if (strcasecmp(key, LAUNCH_JOBKEY_WATCHPATHS) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_WATCHPATHS) == 0) { is_wp = true; + } break; case 'b': case 'B': - if (strcasecmp(key, LAUNCH_JOBKEY_BONJOURFDS) == 0) + if (strcasecmp(key, LAUNCH_JOBKEY_BONJOURFDS) == 0) { socketgroup_setup(value, LAUNCH_JOBKEY_BONJOURFDS, j); + } break; case 's': case 'S': @@ -1172,8 +1218,9 @@ job_t j = context; launch_data_type_t kind; - if (obj == NULL) + if (obj == NULL) { return; + } kind = launch_data_get_type(obj); @@ -1207,11 +1254,12 @@ const char **argv = NULL; job_t j; - if (pload == NULL) + if (pload == NULL) { return NULL; - - if (launch_data_get_type(pload) != LAUNCH_DATA_DICTIONARY) + } + if (launch_data_get_type(pload) != LAUNCH_DATA_DICTIONARY) { return NULL; + } if ((tmp = launch_data_dict_lookup(pload, LAUNCH_JOBKEY_LABEL)) && (launch_data_get_type(tmp) == LAUNCH_DATA_STRING)) { @@ -1247,8 +1295,9 @@ argv[i] = NULL; } - if ((j = job_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) + if ((j = job_new(root_job, label, prog, argv, NULL, MACH_PORT_NULL))) { launch_data_dict_iterate(pload, job_import_keys, j); + } return j; } @@ -1258,15 +1307,18 @@ { job_t jr, ji; - if (label[0] == '\0') + if (label[0] == '\0') { return root_job; + } - if (strcmp(j->label, label) == 0) + if (strcmp(j->label, label) == 0) { return j; + } SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = job_find(ji, label))) + if ((jr = job_find(ji, label))) { return jr; + } } errno = ESRCH; @@ -1300,17 +1352,20 @@ struct machservice *ms; job_t jr, ji; - if (j->bs_port == p) + if (j->bs_port == p) { return j; + } SLIST_FOREACH(ms, &j->machservices, sle) { - if (ms->port == p) + if (ms->port == p) { return j; + } } SLIST_FOREACH(ji, &j->jobs, sle) { - if ((jr = job_find_by_port2(ji, p))) + if ((jr = job_find_by_port2(ji, p))) { return jr; + } } errno = ESRCH; @@ -1329,8 +1384,9 @@ launch_data_t tmp; job_t ji; - if (job_assumes(j, (tmp = job_export2(j, false)) != NULL)) + if (job_assumes(j, (tmp = job_export2(j, false)) != NULL)) { launch_data_dict_insert(where, tmp, j->label); + } SLIST_FOREACH(ji, &j->jobs, sle) job_export_all2(ji, where); @@ -1511,11 +1567,13 @@ bool sipc = false; time_t td; - if (!job_assumes(j, j->req_port == MACH_PORT_NULL)) + if (!job_assumes(j, j->req_port == MACH_PORT_NULL)) { return; + } - if (!job_assumes(j, j->parent != NULL)) + if (!job_assumes(j, j->parent != NULL)) { return; + } if (job_active(j)) { job_log(j, LOG_DEBUG, "Already started"); @@ -1535,17 +1593,19 @@ job_log(j, LOG_DEBUG, "Starting"); - if (!j->legacy_mach_job) - sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); - /* FIXME, using stdinpath is a hack for re-reading the conf file */ - if (j->stdinpath) + if (j->stdinpath) { sipc = true; + } else if (!j->legacy_mach_job) { + sipc = (!SLIST_EMPTY(&j->sockets) || !SLIST_EMPTY(&j->machservices)); + } + j->checkedin = false; - if (sipc) + if (sipc) { socketpair(AF_UNIX, SOCK_STREAM, 0, spair); + } socketpair(AF_UNIX, SOCK_STREAM, 0, execspair); @@ -1572,8 +1632,9 @@ if (j->firstborn) { setpgid(getpid(), getpid()); if (isatty(STDIN_FILENO)) { - if (tcsetpgrp(STDIN_FILENO, getpid()) == -1) + if (tcsetpgrp(STDIN_FILENO, getpid()) == -1) { job_log_error(j, LOG_WARNING, "tcsetpgrp()"); + } } } @@ -1585,8 +1646,9 @@ job_start_child(j, execspair[1]); break; default: - if (!SLIST_EMPTY(&j->machservices)) + if (!SLIST_EMPTY(&j->machservices)) { j->priv_port_has_senders = true; + } j->p = c; total_children++; job_assumes(j, close(execspair[1]) == 0); @@ -1595,14 +1657,16 @@ job_assumes(j, close(spair[1]) == 0); ipc_open(_fd(spair[0]), j); } - if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqjob_callback) == -1) + if (kevent_mod(j->execfd, EVFILT_READ, EV_ADD, 0, 0, &j->kqjob_callback) == -1) { job_log_error(j, LOG_ERR, "kevent_mod(j->execfd): %m"); + } if (kevent_mod(c, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, &j->kqjob_callback) == -1) { job_log_error(j, LOG_ERR, "kevent()"); job_reap(j); } else { - if (j->ondemand) + if (j->ondemand) { job_ignore(j); + } } if (!j->stall_before_exec) { @@ -1628,8 +1692,9 @@ if (j->argv && j->globargv) { g.gl_offs = 1; for (i = 0; i < j->argc; i++) { - if (i > 0) + if (i > 0) { gflags |= GLOB_APPEND; + } if (glob(j->argv[i], gflags, NULL, &g) != 0) { job_log_error(j, LOG_ERR, "glob(\"%s\")", j->argv[i]); exit(EXIT_FAILURE); @@ -1650,18 +1715,21 @@ argv[2] = NULL; } - if (!j->inetcompat) + if (!j->inetcompat) { argv++; + } - if (j->wait4debugger && ptrace(PT_TRACE_ME, getpid(), NULL, 0) == -1) + if (j->wait4debugger && ptrace(PT_TRACE_ME, getpid(), NULL, 0) == -1) { job_log_error(j, LOG_ERR, "ptrace(PT_TRACE_ME, ...)"); + } if (j->force_ppc) { int affinmib[] = { CTL_KERN, KERN_AFFINITY, 1, 1 }; size_t mibsz = sizeof(affinmib) / sizeof(affinmib[0]); - if (sysctl(affinmib, mibsz, NULL, NULL, NULL, 0) == -1) + if (sysctl(affinmib, mibsz, NULL, NULL, NULL, 0) == -1) { job_log_error(j, LOG_WARNING, "Failed to force PowerPC execution"); + } } if (j->prog) { @@ -1696,8 +1764,9 @@ gid_t desired_gid = -1; uid_t desired_uid = -1; - if (getuid() != 0) + if (getuid() != 0) { return; + } if (j->username) { if ((pwe = getpwnam(j->username)) == NULL) { @@ -1772,17 +1841,21 @@ continue; } - if (li->sethard) + if (li->sethard) { rl.rlim_max = li->lim.rlim_max; - if (li->setsoft) + } + if (li->setsoft) { rl.rlim_cur = li->lim.rlim_cur; + } - if (setrlimit(li->which, &rl) == -1) + if (setrlimit(li->which, &rl) == -1) { job_log_error(j, LOG_WARNING, "setrlimit()"); + } } - if (!j->inetcompat && j->session_create) + if (!j->inetcompat && j->session_create) { launchd_SessionCreate(); + } if (j->low_pri_io) { if (setiopolicy_np(IOPOL_TYPE_DISK, IOPOL_SCOPE_PROCESS, IOPOL_THROTTLE) == -1) { @@ -1847,8 +1920,9 @@ struct dirent *de; bool r = 0; - if (!dd) + if (!dd) { return -1; + } while ((de = readdir(dd))) { if (strcmp(de->d_name, ".") && strcmp(de->d_name, "..")) { @@ -1903,8 +1977,9 @@ } newlabel[o] = '\0'; - if (j->parent) + if (j->parent) { r = job_prep_log_preface(j->parent, buf); + } return r + sprintf(buf + r, "%s%s", j->parent ? "/" : "", newlabel); } @@ -1928,8 +2003,9 @@ } else { strlcpy(buf, rcs_rev_tmp + 1, sizeof(buf)); rcs_rev_tmp = strchr(buf, ' '); - if (rcs_rev_tmp) + if (rcs_rev_tmp) { *rcs_rev_tmp = '\0'; + } } job_log(j, LOG_NOTICE, "Bug: %s:%u (%s):%u: %s", file, line, buf, saved_errno, test); @@ -1972,8 +2048,9 @@ { struct watchpath *wp = calloc(1, sizeof(struct watchpath) + strlen(name) + 1); - if (!job_assumes(j, wp != NULL)) + if (!job_assumes(j, wp != NULL)) { return false; + } wp->is_qdir = qdir; @@ -1989,8 +2066,9 @@ void watchpath_delete(job_t j, struct watchpath *wp) { - if (wp->fd != -1) + if (wp->fd != -1) { job_assumes(j, close(wp->fd) != -1); + } SLIST_REMOVE(&j->vnodes, wp, watchpath, sle); @@ -2012,20 +2090,24 @@ int fflags = NOTE_WRITE|NOTE_EXTEND|NOTE_ATTRIB|NOTE_LINK; int qdir_file_cnt; - if (!wp->is_qdir) + if (!wp->is_qdir) { fflags |= NOTE_DELETE|NOTE_RENAME|NOTE_REVOKE; + } - if (wp->fd == -1) + if (wp->fd == -1) { wp->fd = _fd(open(wp->name, O_EVTONLY|O_NOCTTY|O_NOFOLLOW)); + } - if (wp->fd == -1) + if (wp->fd == -1) { return job_log_error(j, LOG_ERR, "Watchpath monitoring failed on \"%s\"", wp->name); + } job_log(j, LOG_DEBUG, "Watching Vnode: %d", wp->fd); job_assumes(j, kevent_mod(wp->fd, EVFILT_VNODE, EV_ADD|EV_CLEAR, fflags, 0, j) != -1); - if (!wp->is_qdir) + if (!wp->is_qdir) { return; + } if (-1 == (qdir_file_cnt = dir_has_files(j, wp->name))) { job_log_error(j, LOG_ERR, "dir_has_files(\"%s\", ...)", wp->name); @@ -2041,8 +2123,9 @@ int dir_file_cnt; SLIST_FOREACH(wp, &j->vnodes, sle) { - if (wp->fd == (int)kev->ident) + if (wp->fd == (int)kev->ident) { break; + } } job_assumes(j, wp != NULL); @@ -2081,19 +2164,25 @@ tmptm.tm_wday = -1; tmptm.tm_mon = -1; - if (LAUNCH_DATA_DICTIONARY != launch_data_get_type(obj)) + if (LAUNCH_DATA_DICTIONARY != launch_data_get_type(obj)) { return false; + } - if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_MINUTE))) + if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_MINUTE))) { tmptm.tm_min = launch_data_get_integer(tmp_k); - if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_HOUR))) + } + if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_HOUR))) { tmptm.tm_hour = launch_data_get_integer(tmp_k); - if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_DAY))) + } + if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_DAY))) { tmptm.tm_mday = launch_data_get_integer(tmp_k); - if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_WEEKDAY))) + } + if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_WEEKDAY))) { tmptm.tm_wday = launch_data_get_integer(tmp_k); - if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_MONTH))) + } + if ((tmp_k = launch_data_dict_lookup(obj, LAUNCH_JOBKEY_CAL_MONTH))) { tmptm.tm_mon = launch_data_get_integer(tmp_k); + } return calendarinterval_new(j, &tmptm); } @@ -2103,8 +2192,9 @@ { struct calendarinterval *ci = calloc(1, sizeof(struct calendarinterval)); - if (!job_assumes(j, ci != NULL)) + if (!job_assumes(j, ci != NULL)) { return false; + } ci->when = *w; @@ -2131,8 +2221,9 @@ struct calendarinterval *ci; SLIST_FOREACH(ci, &j->cal_intervals, sle) { - if ((uintptr_t)ci == kev->ident) + if ((uintptr_t)ci == kev->ident) { break; + } } if (job_assumes(j, ci != NULL)) { @@ -2146,8 +2237,9 @@ { struct socketgroup *sg = calloc(1, sizeof(struct socketgroup) + strlen(name) + 1); - if (!job_assumes(j, sg != NULL)) + if (!job_assumes(j, sg != NULL)) { return false; + } sg->fds = calloc(1, fd_cnt * sizeof(int)); sg->fd_cnt = fd_cnt; @@ -2186,8 +2278,9 @@ char buf[10000]; unsigned int i, buf_off = 0; - if (sg->junkfds) + if (sg->junkfds) { return; + } for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); @@ -2204,8 +2297,9 @@ char buf[10000]; unsigned int i, buf_off = 0; - if (sg->junkfds) + if (sg->junkfds) { return; + } for (i = 0; i < sg->fd_cnt; i++) buf_off += sprintf(buf + buf_off, " %d", sg->fds[i]); @@ -2227,8 +2321,9 @@ { struct envitem *ei = calloc(1, sizeof(struct envitem) + strlen(k) + 1 + strlen(v) + 1); - if (!job_assumes(j, ei != NULL)) + if (!job_assumes(j, ei != NULL)) { return false; + } strcpy(ei->key, k); ei->value = ei->key + strlen(k) + 1; @@ -2260,8 +2355,9 @@ { job_t j = context; - if (launch_data_get_type(obj) != LAUNCH_DATA_STRING) + if (launch_data_get_type(obj) != LAUNCH_DATA_STRING) { return; + } envitem_new(j, key, launch_data_get_string(obj), j->importing_global_env); } @@ -2272,15 +2368,17 @@ struct limititem *li; SLIST_FOREACH(li, &j->limits, sle) { - if (li->which == w) + if (li->which == w) { break; + } } if (li == NULL) { li = calloc(1, sizeof(struct limititem)); - if (!job_assumes(j, li != NULL)) + if (!job_assumes(j, li != NULL)) { return false; + } li->which = w; } @@ -2311,18 +2409,21 @@ int i, limits_cnt = (sizeof(launchd_keys2limits) / sizeof(launchd_keys2limits[0])); rlim_t rl; - if (launch_data_get_type(obj) != LAUNCH_DATA_INTEGER) + if (launch_data_get_type(obj) != LAUNCH_DATA_INTEGER) { return; + } rl = launch_data_get_integer(obj); for (i = 0; i < limits_cnt; i++) { - if (strcasecmp(launchd_keys2limits[i].key, key) == 0) + if (strcasecmp(launchd_keys2limits[i].key, key) == 0) { break; + } } - if (i == limits_cnt) + if (i == limits_cnt) { return; + } limititem_update(j, launchd_keys2limits[i].val, rl); } @@ -2416,8 +2517,9 @@ } /* Maybe another job has the inverse path based semaphore as this job */ - if (dispatch_others) + if (dispatch_others) { job_dispatch_all_other_semaphores(root_job, j); + } return false; } @@ -2439,11 +2541,13 @@ { struct machservice *ms; - if (j->req_port) + if (j->req_port) { return true; + } - if (j->p) + if (j->p) { return true; + } if (j->priv_port_has_senders) { if (j->start_time && !j->checkedin) { @@ -2458,8 +2562,9 @@ } SLIST_FOREACH(ms, &j->machservices, sle) { - if (ms->isActive) + if (ms->isActive) { return true; + } } return false; @@ -2491,8 +2596,9 @@ size_t i; for (i = 0; i < NSIG; i++) { - if (sigismember(&blocked_signals, i)) + if (sigismember(&blocked_signals, i)) { signal(i, SIG_DFL); + } } } @@ -2515,18 +2621,21 @@ { struct machservice *ms; - if ((ms = calloc(1, sizeof(struct machservice) + strlen(name) + 1)) == NULL) + if ((ms = calloc(1, sizeof(struct machservice) + strlen(name) + 1)) == NULL) { return NULL; + } strcpy(ms->name, name); ms->job = j; if (*serviceport == MACH_PORT_NULL) { - if (!job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_create_recv(&ms->port) == KERN_SUCCESS)) { goto out_bad; + } - if (!job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) + if (!job_assumes(j, launchd_mport_make_send(ms->port) == KERN_SUCCESS)) { goto out_bad2; + } *serviceport = ms->port; ms->isActive = false; ms->recv = true; @@ -2720,8 +2829,9 @@ j = job_new(p, bslabel, NULL, NULL, NULL, requestorport); - if (j == NULL) + if (j == NULL) { return NULL; + } if (checkin_port != MACH_PORT_NULL) { j->bs_port = checkin_port; @@ -2733,11 +2843,13 @@ /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); - if (x_bootstrap_subsystem.maxsize > mxmsgsz) + if (x_bootstrap_subsystem.maxsize > mxmsgsz) { mxmsgsz = x_bootstrap_subsystem.maxsize; + } - if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) + if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) { goto out_bad; + } if (p) { job_log(p, LOG_DEBUG, "Mach sub-bootstrap created: %s", j->label); @@ -2746,8 +2858,9 @@ return j; out_bad: - if (j) + if (j) { job_remove(j); + } return NULL; } @@ -2799,25 +2912,30 @@ j = job_get_bs(j); SLIST_FOREACH(ji, &j->jobs, sle) { - if (ji->req_port) + if (ji->req_port) { continue; + } SLIST_FOREACH(ms, &ji->machservices, sle) { - if (strcmp(name, ms->name) == 0) + if (strcmp(name, ms->name) == 0) { return ms; + } } } SLIST_FOREACH(ms, &j->machservices, sle) { - if (strcmp(name, ms->name) == 0) + if (strcmp(name, ms->name) == 0) { return ms; + } } - if (j->parent == NULL) + if (j->parent == NULL) { return NULL; + } - if (!check_parent) + if (!check_parent) { return NULL; + } return job_lookup_service(j->parent, name, true); } @@ -2903,26 +3021,31 @@ while (isspace(*cp)) cp++; term = (*cp == '"') ? *cp++ : '\0'; - if (nargs < NELEM(argv)) + if (nargs < NELEM(argv)) { argv[nargs++] = argp; + } while (*cp && (term ? *cp != term : !isspace(*cp)) && argp < END_OF(args)) { - if (*cp == '\\') + if (*cp == '\\') { cp++; + } *argp++ = *cp; - if (*cp) + if (*cp) { cp++; + } } *argp++ = '\0'; } argv[nargs] = NULL; - if (nargs == 0) + if (nargs == 0) { return NULL; + } argv_ret = malloc((nargs + 1) * sizeof(char *) + strlen(string) + 1); - if (!launchd_assumes(argv_ret != NULL)) + if (!launchd_assumes(argv_ret != NULL)) { return NULL; + } co = (char *)argv_ret + (nargs + 1) * sizeof(char *); @@ -2949,22 +3072,26 @@ struct machservice *ms; SLIST_FOREACH(ji, &j->jobs, sle) { - if (job_ack_port_destruction(ji, p)) + if (job_ack_port_destruction(ji, p)) { return true; + } } SLIST_FOREACH(ms, &j->machservices, sle) { - if (ms->port == p) + if (ms->port == p) { break; + } } - if (ms == NULL) + if (ms == NULL) { return false; + } ms->isActive = false; - if (ms->reset) + if (ms->reset) { machservice_resetport(j, ms); + } job_log(j, LOG_DEBUG, "Receive right returned to us: %s", ms->name); @@ -3001,11 +3128,13 @@ job_t job_get_bs(job_t j) { - if (j->req_port) + if (j->req_port) { return j; + } - if (job_assumes(j, j->parent != NULL)) + if (job_assumes(j, j->parent != NULL)) { return j->parent; + } return NULL; } @@ -3043,16 +3172,19 @@ struct semaphoreitem *si; size_t alloc_sz = sizeof(struct semaphoreitem); - if (what) + if (what) { alloc_sz += strlen(what) + 1; + } - if (!job_assumes(j, si = calloc(1, alloc_sz))) + if (!job_assumes(j, si = calloc(1, alloc_sz))) { return false; + } si->why = why; - if (what) + if (what) { strcpy(si->what, what); + } SLIST_INSERT_HEAD(&j->semaphores, si, sle); @@ -3102,8 +3234,9 @@ { job_t ji, jn; - if (j == nj) + if (j == nj) { return; + } SLIST_FOREACH_SAFE(ji, &j->jobs, sle, jn) { job_dispatch_all_other_semaphores(ji, nj); @@ -3152,8 +3285,9 @@ workingtm.tm_sec = 0; workingtm.tm_min++; - if (wday == 7) + if (wday == 7) { wday = 0; + } while (!(workingtm.tm_wday == wday && cronemu_hour(&workingtm, hour, min))) { workingtm.tm_mday++; @@ -3179,15 +3313,17 @@ workingtm.tm_min = 0; carrytest = workingtm.tm_mon; mktime(&workingtm); - if (carrytest != workingtm.tm_mon) + if (carrytest != workingtm.tm_mon) { return false; + } } *wtm = workingtm; return true; } - if (mon < wtm->tm_mon) + if (mon < wtm->tm_mon) { return false; + } if (mon > wtm->tm_mon) { wtm->tm_mon = mon; @@ -3212,15 +3348,17 @@ workingtm.tm_min = 0; carrytest = workingtm.tm_mday; mktime(&workingtm); - if (carrytest != workingtm.tm_mday) + if (carrytest != workingtm.tm_mday) { return false; + } } *wtm = workingtm; return true; } - if (mday < wtm->tm_mday) + if (mday < wtm->tm_mday) { return false; + } if (mday > wtm->tm_mday) { wtm->tm_mday = mday; @@ -3243,15 +3381,17 @@ workingtm.tm_min = 0; carrytest = workingtm.tm_hour; mktime(&workingtm); - if (carrytest != workingtm.tm_hour) + if (carrytest != workingtm.tm_hour) { return false; + } } *wtm = workingtm; return true; } - if (hour < wtm->tm_hour) + if (hour < wtm->tm_hour) { return false; + } if (hour > wtm->tm_hour) { wtm->tm_hour = hour; @@ -3264,11 +3404,13 @@ bool cronemu_min(struct tm *wtm, int min) { - if (min == -1) + if (min == -1) { return true; + } - if (min < wtm->tm_min) + if (min < wtm->tm_min) { return false; + } if (min > wtm->tm_min) { wtm->tm_min = min; Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 06:20:35 UTC (rev 22877) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 18:25:30 UTC (rev 22878) @@ -96,8 +96,9 @@ launchd_assumes(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); - if (getpid() != 1) + if (getpid() != 1) { launchd_assumes(inherited_bootstrap_port != MACH_PORT_NULL); + } /* We set this explicitly as we start each child */ launchd_assumes(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); @@ -127,8 +128,9 @@ { mach_port_type_t p_type; - if (!launchd_assumes(mach_port_type(mach_task_self(), port, &p_type) == KERN_SUCCESS)) + if (!launchd_assumes(mach_port_type(mach_task_self(), port, &p_type) == KERN_SUCCESS)) { return false; + } return ((p_type & MACH_PORT_TYPE_RECEIVE) != 0); } @@ -174,8 +176,9 @@ js = job_new_via_mach_init(j, server_cmd, server_uid, on_demand); - if (js == NULL) + if (js == NULL) { return BOOTSTRAP_NO_MEMORY; + } *server_portp = job_get_bsport(js); return BOOTSTRAP_SUCCESS; @@ -289,8 +292,9 @@ ms = job_lookup_service(j, servicename, false); if (ms) { - if (machservice_job(ms) != j) + if (machservice_job(ms) != j) { return BOOTSTRAP_NOT_PRIVILEGED; + } if (machservice_active(ms)) { job_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); launchd_assumes(!canReceive(machservice_port(ms))); @@ -410,12 +414,14 @@ job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, false); mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - if (!launchd_assumes(info_resp.service_names != NULL)) + if (!launchd_assumes(info_resp.service_names != NULL)) { goto out_bad; + } mig_allocate((vm_address_t *)&info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); - if (!launchd_assumes(info_resp.service_actives != NULL)) + if (!launchd_assumes(info_resp.service_actives != NULL)) { goto out_bad; + } for (ji = j; ji; ji = job_parent(ji)) job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, false); @@ -462,16 +468,19 @@ job_foreach_service(j, x_bootstrap_info_countservices, &cnt, true); mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - if (!launchd_assumes(info_resp.service_names != NULL)) + if (!launchd_assumes(info_resp.service_names != NULL)) { goto out_bad; + } mig_allocate((vm_address_t *)&info_resp.ports, cnt * sizeof(info_resp.ports[0])); - if (!launchd_assumes(info_resp.ports != NULL)) + if (!launchd_assumes(info_resp.ports != NULL)) { goto out_bad; + } mig_allocate((vm_address_t *)&info_resp.pids, cnt * sizeof(pid_t)); - if (!launchd_assumes(info_resp.pids != NULL)) + if (!launchd_assumes(info_resp.pids != NULL)) { goto out_bad; + } job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, true); @@ -524,8 +533,9 @@ } if ((js = job_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { - if (requestorport == MACH_PORT_NULL) + if (requestorport == MACH_PORT_NULL) { return BOOTSTRAP_NOT_PRIVILEGED; + } return BOOTSTRAP_NO_MEMORY; } @@ -555,8 +565,9 @@ *serviceportp = MACH_PORT_NULL; ms = machservice_new(j, servicename, serviceportp); - if (!launchd_assumes(ms != NULL)) + if (!launchd_assumes(ms != NULL)) { goto out_bad; + } return BOOTSTRAP_SUCCESS; @@ -581,8 +592,9 @@ { job_t j = job_find_by_port(bp); - if (!j) + if (!j) { return BOOTSTRAP_NOT_PRIVILEGED; + } job_uncork_fork(j); @@ -677,16 +689,21 @@ * warning level here. */ - if (inherited_asid == ldc->asid) + if (inherited_asid == ldc->asid) { return true; - if (progeny_check(ldc->pid)) + } + if (progeny_check(ldc->pid)) { return true; - if (ldc->euid == geteuid()) + } + if (ldc->euid == geteuid()) { return true; - if (ldc->euid == 0 && ldc->uid == 0) + } + if (ldc->euid == 0 && ldc->uid == 0) { return true; - if (last_warned_pid == ldc->pid) + } + if (last_warned_pid == ldc->pid) { return false; + } job_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-24 06:20:35 UTC (rev 22877) +++ trunk/launchd/src/launchd_runtime.c 2006-09-24 18:25:30 UTC (rev 22878) @@ -99,8 +99,9 @@ /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ mxmsgsz = sizeof(union __RequestUnion__x_launchd_internal_subsystem); - if (x_launchd_internal_subsystem.maxsize > mxmsgsz) + if (x_launchd_internal_subsystem.maxsize > mxmsgsz) { mxmsgsz = x_launchd_internal_subsystem.maxsize; + } launchd_assert(runtime_add_mport(launchd_internal_port, launchd_internal_demux, mxmsgsz) == KERN_SUCCESS); @@ -146,8 +147,9 @@ struct kevent kev; unsigned int i; - if (!launchd_assumes(mach_port_get_set_status(mach_task_self(), demand_port_set, &members, &membersCnt) == KERN_SUCCESS)) + if (!launchd_assumes(mach_port_get_set_status(mach_task_self(), demand_port_set, &members, &membersCnt) == KERN_SUCCESS)) { return 1; + } for (i = 0; i < membersCnt; i++) { statusCnt = MACH_PORT_RECEIVE_STATUS_COUNT; @@ -177,8 +179,9 @@ for (;;) { FD_ZERO(&rfds); FD_SET(mainkq, &rfds); - if (launchd_assumes(select(mainkq + 1, &rfds, NULL, NULL, NULL) == 1)) + if (launchd_assumes(select(mainkq + 1, &rfds, NULL, NULL, NULL) == 1)) { launchd_assumes(handle_kqueue(launchd_internal_port, mainkq) == 0); + } } return NULL; @@ -193,8 +196,9 @@ launchd_assumes((kevr = kevent(fd, NULL, 0, &kev, 1, &ts)) != -1); - if (kevr == 1) + if (kevr == 1) { (*((kq_callback *)kev.udata))(kev.udata, &kev); + } launchd_post_kevent(); @@ -256,15 +260,17 @@ if (which == MACH_NOTIFY_NO_SENDERS) { /* Always make sure the send count is zero, in case a receive right is reused */ errno = mach_port_set_mscount(mach_task_self(), name, 0); - if (errno != KERN_SUCCESS) + if (errno != KERN_SUCCESS) { return errno; + } } errno = mach_port_request_notification(mach_task_self(), name, which, msgc, where, MACH_MSG_TYPE_MAKE_SEND_ONCE, &previous); - if (errno == 0 && previous != MACH_PORT_NULL) + if (errno == 0 && previous != MACH_PORT_NULL) { launchd_assumes(launchd_mport_deallocate(previous) == KERN_SUCCESS); + } return errno; } @@ -293,8 +299,9 @@ needed_table_sz *= 2; /* Let's try and avoid realloc'ing for a while */ mig_callback *new_table = malloc(needed_table_sz); - if (!launchd_assumes(new_table != NULL)) + if (!launchd_assumes(new_table != NULL)) { return KERN_RESOURCE_SHORTAGE; + } if (mig_cb_table) { memcpy(new_table, mig_cb_table, mig_cb_table_sz); @@ -352,8 +359,9 @@ struct kevent kev; int q = mainkq; - if (EVFILT_TIMER == filter || EVFILT_VNODE == filter) + if (EVFILT_TIMER == filter || EVFILT_VNODE == filter) { q = asynckq; + } if (flags & EV_ADD && !launchd_assumes(udata != NULL)) { errno = EINVAL; @@ -424,8 +432,9 @@ * objects goes away. */ - if (!launchd_assumes(j != NULL)) + if (!launchd_assumes(j != NULL)) { return KERN_FAILURE; + } job_ack_no_senders(j); Modified: trunk/launchd/src/launchd_unix_ipc.c =================================================================== --- trunk/launchd/src/launchd_unix_ipc.c 2006-09-24 06:20:35 UTC (rev 22877) +++ trunk/launchd/src/launchd_unix_ipc.c 2006-09-24 18:25:30 UTC (rev 22878) @@ -74,13 +74,15 @@ void ipc_clean_up(void) { - if (ipc_self != getpid()) + if (ipc_self != getpid()) { return; + } - if (-1 == unlink(sockpath)) + if (-1 == unlink(sockpath)) { syslog(LOG_WARNING, "unlink(\"%s\"): %m", sockpath); - else if (-1 == rmdir(sockdir)) + } else if (-1 == rmdir(sockdir)) { syslog(LOG_WARNING, "rmdir(\"%s\"): %m", sockdir); + } } void @@ -92,11 +94,13 @@ char ourdir[1024]; size_t i; - if (ipc_inited) + if (ipc_inited) { return; + } - if (fds) + if (fds) { goto add_fds; + } memset(&sun, 0, sizeof(sun)); sun.sun_family = AF_UNIX; @@ -124,28 +128,32 @@ } } else { snprintf(ourdir, sizeof(ourdir), "/tmp/launchd-%u.XXXXXX", getpid()); - if (!launchd_assumes(mkdtemp(ourdir) != NULL)) + if (!launchd_assumes(mkdtemp(ourdir) != NULL)) { goto out_bad; + } snprintf(sun.sun_path, sizeof(sun.sun_path), "%s/sock", ourdir); setenv(LAUNCHD_SOCKET_ENV, sun.sun_path, 1); } if (unlink(sun.sun_path) == -1 && errno != ENOENT) { - if (errno != EROFS) + if (errno != EROFS) { syslog(LOG_ERR, "unlink(\"thesocket\"): %m"); + } goto out_bad; } - if (!launchd_assumes((fd = _fd(socket(AF_UNIX, SOCK_STREAM, 0))) != -1)) + if (!launchd_assumes((fd = _fd(socket(AF_UNIX, SOCK_STREAM, 0))) != -1)) { goto out_bad; + } oldmask = umask(S_IRWXG|S_IRWXO); r = bind(fd, (struct sockaddr *)&sun, sizeof(sun)); umask(oldmask); if (r == -1) { - if (errno != EROFS) + if (errno != EROFS) { syslog(LOG_ERR, "bind(\"thesocket\"): %m"); + } goto out_bad; } @@ -177,8 +185,9 @@ } out_bad: - if (!ipc_inited && fd != -1) + if (!ipc_inited && fd != -1) { launchd_assumes(close(fd) == 0); + } } void @@ -217,8 +226,9 @@ if (kev->filter == EVFILT_READ) { if (launchd_msg_recv(c->conn, ipc_readmsg, c) == -1 && errno != EAGAIN) { - if (errno != ECONNRESET) + if (errno != ECONNRESET) { syslog(LOG_DEBUG, "%s(): recv: %m", __func__); + } ipc_close(c); } } else if (kev->filter == EVFILT_WRITE) { @@ -256,8 +266,9 @@ ipc_close_fds(launch_data_array_get_index(o, i)); break; case LAUNCH_DATA_FD: - if (launch_data_get_fd(o) != -1) + if (launch_data_get_fd(o) != -1) { launchd_assumes(close(launch_data_get_fd(o)) == 0); + } break; default: break; @@ -303,8 +314,9 @@ rmc.resp = launch_data_new_errno(EINVAL); } - if (NULL == rmc.resp) + if (NULL == rmc.resp) { rmc.resp = launch_data_new_errno(ENOSYS); + } ipc_close_fds(msg); @@ -327,8 +339,9 @@ launch_data_t resp = NULL; job_t j; - if (rmc->resp) + if (rmc->resp) { return; + } if (data == NULL) { if (!strcmp(cmd, LAUNCH_KEY_CHECKIN)) { @@ -405,8 +418,9 @@ if (launch_data_get_type(data) == LAUNCH_DATA_ARRAY) { resp = job_import_bulk(data); } else { - if (job_import(data)) + if (job_import(data)) { errno = 0; + } resp = launch_data_new_errno(errno); } } else if (!strcmp(cmd, LAUNCH_KEY_UNSETUSERENVIRONMENT)) { @@ -477,8 +491,9 @@ } for (i = 0; i < (ltmpsz / sizeof(struct rlimit)); i++) { - if (ltmp[i].rlim_cur == l[i].rlim_cur && ltmp[i].rlim_max == l[i].rlim_max) + if (ltmp[i].rlim_cur == l[i].rlim_cur && ltmp[i].rlim_max == l[i].rlim_max) { continue; + } if (/* XXX readcfg_pid && */ getpid() == 1 && (i == RLIMIT_NOFILE || i == RLIMIT_NPROC)) { int gmib[] = { CTL_KERN, KERN_MAXPROC }; @@ -496,8 +511,9 @@ break; case RLIMIT_NPROC: /* kernel will not clamp to this value, we must */ - if (gval > (2048 + 20)) + if (gval > (2048 + 20)) { gval = 2048 + 20; + } break; default: break; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060924/6c953f5a/attachment.html From source_changes at macosforge.org Sun Sep 24 13:01:11 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22879] trunk/launchd/src Message-ID: <20060924200111.016DF1548FD@cvs.opensource.apple.com> Revision: 22879 http://trac.macosforge.org/projects/launchd/changeset/22879 Author: zarzycki@apple.com Date: 2006-09-24 13:01:11 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Adopt MIG's automatic type conversion feature. This will make our life easier in the long run. Modified Paths: -------------- trunk/launchd/src/bootstrap.defs trunk/launchd/src/bootstrap_private.h trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h trunk/launchd/src/launchd_mach_ipc.c trunk/launchd/src/launchd_runtime.c Modified: trunk/launchd/src/bootstrap.defs =================================================================== --- trunk/launchd/src/bootstrap.defs 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/bootstrap.defs 2006-09-24 20:01:11 UTC (rev 22879) @@ -39,11 +39,18 @@ type bootstrap_status_t = integer_t; type bootstrap_status_array_t = ^array [] of bootstrap_status_t; +type job_t = mach_port_t + intran: job_t job_mig_intran(mach_port_t) + outtran: mach_port_t job_mig_outtran(job_t) + destructor: job_mig_destructor(job_t) + cusertype: vproc_mig_t; + + userprefix raw_; serverprefix x_; routine bootstrap_create_server( - __bs_port : mach_port_t; + __bs_port : job_t; __server_cmd : cmd_t; __server_uid : natural_t; __on_demand : boolean_t; @@ -53,19 +60,19 @@ skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ routine bootstrap_check_in( - __bs_port : mach_port_t; + __bs_port : job_t; __service_name : name_t; ServerAuditToken __token : audit_token_t; out __service_port : mach_port_move_receive_t); routine bootstrap_register( - __bs_port : mach_port_t; + __bs_port : job_t; ServerAuditToken __token : audit_token_t; __service_name : name_t; __service_port : mach_port_t); routine bootstrap_look_up( - __bs_port : mach_port_t; + __bs_port : job_t; ServerAuditToken __token : audit_token_t; __service_name : name_t; out __service_port : mach_port_send_t); @@ -73,28 +80,28 @@ skip; /* last used in 10.4 */ routine bootstrap_parent( - __bs_port : mach_port_t; + __bs_port : job_t; out __parent_port : mach_port_send_t); skip; /* last used in 10.4 */ routine bootstrap_info( - __bs_port : mach_port_t; + __bs_port : job_t; out __service_names : name_array_t, dealloc; out __service_active : bootstrap_status_array_t, dealloc); routine bootstrap_subset( - __bs_port : mach_port_t; + __bs_port : job_t; __requestor_port: mach_port_t; out __subset_port : mach_port_make_send_t); routine bootstrap_create_service( - __bs_port : mach_port_t; + __bs_port : job_t; __service_name : name_t; out __service_port : mach_port_t); routine bootstrap_transfer_subset( - __bs_port : mach_port_t; + __bs_port : job_t; out __bs_reqport : mach_port_t; out __bs_rcvright : mach_port_move_receive_t; out __service_names : name_array_t, dealloc; @@ -102,11 +109,11 @@ out __service_ports : mach_port_array_t, dealloc); routine bootstrap_getsocket( - __bs_port : mach_port_t; + __bs_port : job_t; out __sockpath : name_t); routine mpm_spawn( - __bs_port : mach_port_t; + __bs_port : job_t; ServerAuditToken __token : audit_token_t; __chars : _internal_string_t; __argc : uint32_t; @@ -117,17 +124,17 @@ out __obsvr_port : mach_port_make_send_t); routine mpm_wait( - __bs_port : mach_port_t; + __bs_port : job_t; sreplyport __rport : mach_port_make_send_once_t; ServerAuditToken __token : audit_token_t; out __waitval : integer_t); routine mpm_uncork_fork( - __bs_port : mach_port_t; + __bs_port : job_t; ServerAuditToken __token : audit_token_t); /* Essentially the inverse of bootstrap_unprivileged() */ routine bootstrap_get_self( - __bs_port : mach_port_t; + __bs_port : job_t; ServerAuditToken __token : audit_token_t; out __job_port : mach_port_make_send_t); Modified: trunk/launchd/src/bootstrap_private.h =================================================================== --- trunk/launchd/src/bootstrap_private.h 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/bootstrap_private.h 2006-09-24 20:01:11 UTC (rev 22879) @@ -20,7 +20,14 @@ * @APPLE_APACHE_LICENSE_HEADER_END@ */ -typedef char *_internal_string_t; +typedef char * _internal_string_t; +typedef mach_port_t vproc_mig_t; + +#ifdef bootstrap_MSG_COUNT +/* HACK */ +#include "launchd_core_logic.h" +#endif + #define SPAWN_HAS_PATH 0x0001 #define SPAWN_HAS_WDIR 0x0002 #define SPAWN_HAS_UMASK 0x0004 Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 20:01:11 UTC (rev 22879) @@ -1373,12 +1373,17 @@ } job_t -job_find_by_port(mach_port_t p) +job_mig_intran(mach_port_t p) { return job_find_by_port2(root_job, p); } void +job_mig_destructor(job_t j __attribute__((unused))) +{ +} + +void job_export_all2(job_t j, launch_data_t where) { launch_data_t tmp; Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-24 20:01:11 UTC (rev 22879) @@ -21,6 +21,7 @@ */ #include "bootstrap_public.h" +#include "launch.h" #define job_assumes(j, e) \ (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) @@ -43,7 +44,8 @@ job_t job_find(job_t j, const char *label); job_t job_find_by_pid(job_t j, pid_t p, bool recurse); -job_t job_find_by_port(mach_port_t mp); +job_t job_mig_intran(mach_port_t mp); +void job_mig_destructor(job_t j); job_t job_import(launch_data_t pload); launch_data_t job_import_bulk(launch_data_t pload); job_t job_new(job_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 20:01:11 UTC (rev 22879) @@ -53,13 +53,13 @@ #include #include +#include "launchd_core_logic.h" #include "bootstrap_public.h" #include "bootstrap_private.h" #include "bootstrap.h" #include "bootstrapServer.h" #include "launchd.h" #include "launchd_runtime.h" -#include "launchd_core_logic.h" #include "launch_priv.h" #include "launchd_unix_ipc.h" @@ -145,11 +145,11 @@ } kern_return_t -x_bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, +x_bootstrap_create_server(job_t j, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, audit_token_t au_tok, mach_port_t *server_portp) { - job_t js, j = job_find_by_port(bp); struct ldcred ldc; + job_t js; audit_token_to_launchd_cred(au_tok, &ldc); @@ -185,7 +185,7 @@ } kern_return_t -x_bootstrap_getsocket(mach_port_t bp, name_t spr) +x_bootstrap_getsocket(job_t j, name_t spr) { if (!sockpath) { return BOOTSTRAP_NO_MEMORY; @@ -199,10 +199,10 @@ } kern_return_t -x_bootstrap_get_self(mach_port_t bp, audit_token_t au_tok, mach_port_t *unprivportp) +x_bootstrap_get_self(job_t j, audit_token_t au_tok, mach_port_t *unprivportp) { - job_t j2, j = job_find_by_port(bp); struct ldcred ldc; + job_t j2; audit_token_to_launchd_cred(au_tok, &ldc); @@ -229,10 +229,9 @@ kern_return_t -x_bootstrap_check_in(mach_port_t bp, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) +x_bootstrap_check_in(job_t j, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) { static pid_t last_warned_pid = 0; - job_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -267,11 +266,11 @@ } kern_return_t -x_bootstrap_register(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) +x_bootstrap_register(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { - job_t j2, j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; + job_t j2; audit_token_to_launchd_cred(au_tok, &ldc); @@ -316,9 +315,8 @@ } kern_return_t -x_bootstrap_look_up(mach_port_t bp, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) +x_bootstrap_look_up(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) { - job_t j = job_find_by_port(bp); struct machservice *ms; struct ldcred ldc; @@ -347,10 +345,8 @@ } kern_return_t -x_bootstrap_parent(mach_port_t bp, mach_port_t *parentport, mach_msg_type_name_t *pptype) +x_bootstrap_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype) { - job_t j = job_find_by_port(bp); - job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); j = job_get_bs(j); @@ -403,12 +399,12 @@ } kern_return_t -x_bootstrap_info(mach_port_t bp, name_array_t *servicenamesp, unsigned int *servicenames_cnt, +x_bootstrap_info(job_t j, name_array_t *servicenamesp, unsigned int *servicenames_cnt, bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; - job_t ji, j = job_find_by_port(bp); unsigned int cnt = 0; + job_t ji; for (ji = j; ji; ji = job_parent(ji)) job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, false); @@ -446,13 +442,12 @@ } kern_return_t -x_bootstrap_transfer_subset(mach_port_t bp, mach_port_t *reqport, mach_port_t *rcvright, +x_bootstrap_transfer_subset(job_t j, mach_port_t *reqport, mach_port_t *rcvright, name_array_t *servicenamesp, unsigned int *servicenames_cnt, vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, mach_port_array_t *ports, unsigned int *ports_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; - job_t j = job_find_by_port(bp); unsigned int cnt = 0; if (getpid() != 1) { @@ -516,16 +511,15 @@ } kern_return_t -x_bootstrap_subset(mach_port_t bp, mach_port_t requestorport, mach_port_t *subsetportp) +x_bootstrap_subset(job_t j, mach_port_t requestorport, mach_port_t *subsetportp) { - job_t js, j = job_find_by_port(bp); int bsdepth = 0; + job_t js = j; - while ((j = job_parent(j)) != NULL) + while ((js = job_parent(js)) != NULL) { bsdepth++; + } - j = job_find_by_port(bp); - /* Since we use recursion, we need an artificial depth for subsets */ if (bsdepth > 100) { job_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); @@ -544,9 +538,8 @@ } kern_return_t -x_bootstrap_create_service(mach_port_t bp, name_t servicename, mach_port_t *serviceportp) +x_bootstrap_create_service(job_t j, name_t servicename, mach_port_t *serviceportp) { - job_t j = job_find_by_port(bp); struct machservice *ms; if (job_prog(j)[0] == '\0') { @@ -577,9 +570,8 @@ } kern_return_t -x_mpm_wait(mach_port_t bp, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) +x_mpm_wait(job_t j, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) { - job_t j = job_find_by_port(bp); #if 0 struct ldcred ldc; audit_token_to_launchd_cred(au_tok, &ldc); @@ -588,10 +580,8 @@ } kern_return_t -x_mpm_uncork_fork(mach_port_t bp, audit_token_t au_tok) +x_mpm_uncork_fork(job_t j, audit_token_t au_tok) { - job_t j = job_find_by_port(bp); - if (!j) { return BOOTSTRAP_NOT_PRIVILEGED; } @@ -602,12 +592,12 @@ } kern_return_t -x_mpm_spawn(mach_port_t bp, audit_token_t au_tok, +x_mpm_spawn(job_t j, audit_token_t au_tok, _internal_string_t charbuf, mach_msg_type_number_t charbuf_cnt, uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, pid_t *child_pid, mach_port_t *obsvr_port) { - job_t jr, j = job_find_by_port(bp); + job_t jr; struct ldcred ldc; size_t offset = 0; char *tmpp; Modified: trunk/launchd/src/launchd_runtime.c =================================================================== --- trunk/launchd/src/launchd_runtime.c 2006-09-24 18:25:30 UTC (rev 22878) +++ trunk/launchd/src/launchd_runtime.c 2006-09-24 20:01:11 UTC (rev 22879) @@ -158,7 +158,7 @@ continue; } if (status.mps_msgcount) { - EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_find_by_port(members[i])); + EV_SET(&kev, members[i], EVFILT_MACHPORT, 0, 0, 0, job_mig_intran(members[i])); (*((kq_callback *)kev.udata))(kev.udata, &kev); /* the callback may have tainted our ability to continue this for loop */ break; @@ -426,7 +426,7 @@ kern_return_t do_mach_notify_no_senders(mach_port_t notify, mach_port_mscount_t mscount) { - job_t j = job_find_by_port(notify); + job_t j = job_mig_intran(notify); /* This message is sent to us when the last customer of one of our * objects goes away. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060924/4ce3d4d5/attachment.html From source_changes at macosforge.org Sun Sep 24 14:04:06 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22880] trunk/launchd/src Message-ID: <20060924210406.25ECB154D86@cvs.opensource.apple.com> Revision: 22880 http://trac.macosforge.org/projects/launchd/changeset/22880 Author: zarzycki@apple.com Date: 2006-09-24 14:04:05 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Just a simple rename of internal symbols. More trending toward the vproc_t/vprocmgr_t APIs... Modified Paths: -------------- trunk/launchd/src/bootstrap.defs trunk/launchd/src/bootstrap_public.c trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/bootstrap.defs =================================================================== --- trunk/launchd/src/bootstrap.defs 2006-09-24 20:01:11 UTC (rev 22879) +++ trunk/launchd/src/bootstrap.defs 2006-09-24 21:04:05 UTC (rev 22880) @@ -46,10 +46,10 @@ cusertype: vproc_mig_t; -userprefix raw_; -serverprefix x_; +userprefix vproc_mig_; +serverprefix job_mig_; -routine bootstrap_create_server( +routine create_server( __bs_port : job_t; __server_cmd : cmd_t; __server_uid : natural_t; @@ -59,19 +59,19 @@ skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ -routine bootstrap_check_in( +routine check_in( __bs_port : job_t; __service_name : name_t; ServerAuditToken __token : audit_token_t; out __service_port : mach_port_move_receive_t); -routine bootstrap_register( +routine register( __bs_port : job_t; ServerAuditToken __token : audit_token_t; __service_name : name_t; __service_port : mach_port_t); -routine bootstrap_look_up( +routine look_up( __bs_port : job_t; ServerAuditToken __token : audit_token_t; __service_name : name_t; @@ -79,28 +79,28 @@ skip; /* last used in 10.4 */ -routine bootstrap_parent( +routine parent( __bs_port : job_t; out __parent_port : mach_port_send_t); skip; /* last used in 10.4 */ -routine bootstrap_info( +routine info( __bs_port : job_t; out __service_names : name_array_t, dealloc; out __service_active : bootstrap_status_array_t, dealloc); -routine bootstrap_subset( +routine subset( __bs_port : job_t; __requestor_port: mach_port_t; out __subset_port : mach_port_make_send_t); -routine bootstrap_create_service( +routine create_service( __bs_port : job_t; __service_name : name_t; out __service_port : mach_port_t); -routine bootstrap_transfer_subset( +routine transfer_subset( __bs_port : job_t; out __bs_reqport : mach_port_t; out __bs_rcvright : mach_port_move_receive_t; @@ -108,11 +108,11 @@ out __service_pids : pointer_t, dealloc; out __service_ports : mach_port_array_t, dealloc); -routine bootstrap_getsocket( +routine getsocket( __bs_port : job_t; out __sockpath : name_t); -routine mpm_spawn( +routine spawn( __bs_port : job_t; ServerAuditToken __token : audit_token_t; __chars : _internal_string_t; @@ -123,18 +123,18 @@ out __pid : pid_t; out __obsvr_port : mach_port_make_send_t); -routine mpm_wait( +routine wait( __bs_port : job_t; sreplyport __rport : mach_port_make_send_once_t; ServerAuditToken __token : audit_token_t; out __waitval : integer_t); -routine mpm_uncork_fork( +routine uncork_fork( __bs_port : job_t; ServerAuditToken __token : audit_token_t); /* Essentially the inverse of bootstrap_unprivileged() */ -routine bootstrap_get_self( +routine get_self( __bs_port : job_t; ServerAuditToken __token : audit_token_t; out __job_port : mach_port_make_send_t); Modified: trunk/launchd/src/bootstrap_public.c =================================================================== --- trunk/launchd/src/bootstrap_public.c 2006-09-24 20:01:11 UTC (rev 22879) +++ trunk/launchd/src/bootstrap_public.c 2006-09-24 21:04:05 UTC (rev 22880) @@ -44,7 +44,7 @@ vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, mach_port_array_t *ports, mach_msg_type_number_t *portCnt) { - return raw_bootstrap_transfer_subset(bp, reqport, rcvright, service_names, service_namesCnt, service_pids, service_pidsCnt, ports, portCnt); + return vproc_mig_transfer_subset(bp, reqport, rcvright, service_names, service_namesCnt, service_pids, service_pidsCnt, ports, portCnt); } pid_t @@ -114,7 +114,7 @@ break; } - kr = raw_mpm_spawn(bootstrap_port, buf, buf_len, argc, envc, flags, u_mask, &p, &obsvr_port); + kr = vproc_mig_spawn(bootstrap_port, buf, buf_len, argc, envc, flags, u_mask, &p, &obsvr_port); free(buf); @@ -141,25 +141,25 @@ kern_return_t mpm_wait(mach_port_t ajob, int *wstatus) { - return raw_mpm_wait(ajob, wstatus); + return vproc_mig_wait(ajob, wstatus); } kern_return_t mpm_uncork_fork(mach_port_t ajob) { - return raw_mpm_uncork_fork(ajob); + return vproc_mig_uncork_fork(ajob); } kern_return_t bootstrap_create_server(mach_port_t bp, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, mach_port_t *server_port) { - return raw_bootstrap_create_server(bp, server_cmd, server_uid, on_demand, server_port); + return vproc_mig_create_server(bp, server_cmd, server_uid, on_demand, server_port); } kern_return_t bootstrap_subset(mach_port_t bp, mach_port_t requestor_port, mach_port_t *subset_port) { - return raw_bootstrap_subset(bp, requestor_port, subset_port); + return vproc_mig_subset(bp, requestor_port, subset_port); } kern_return_t @@ -181,25 +181,25 @@ kern_return_t bootstrap_getsocket(mach_port_t bp, name_t sockpath) { - return raw_bootstrap_getsocket(bp, sockpath); + return vproc_mig_getsocket(bp, sockpath); } kern_return_t bootstrap_parent(mach_port_t bp, mach_port_t *parent_port) { - return raw_bootstrap_parent(bp, parent_port); + return vproc_mig_parent(bp, parent_port); } kern_return_t bootstrap_register(mach_port_t bp, name_t service_name, mach_port_t sp) { - return raw_bootstrap_register(bp, service_name, sp); + return vproc_mig_register(bp, service_name, sp); } kern_return_t bootstrap_create_service(mach_port_t bp, name_t service_name, mach_port_t *sp) { - return raw_bootstrap_create_service(bp, service_name, sp); + return vproc_mig_create_service(bp, service_name, sp); } kern_return_t @@ -211,13 +211,13 @@ vproc_get_self(); - return raw_bootstrap_check_in(vproc_self, service_name, sp); + return vproc_mig_check_in(vproc_self, service_name, sp); } kern_return_t bootstrap_look_up(mach_port_t bp, name_t service_name, mach_port_t *sp) { - return raw_bootstrap_look_up(bp, service_name, sp); + return vproc_mig_look_up(bp, service_name, sp); } kern_return_t @@ -274,7 +274,7 @@ name_array_t *service_names, mach_msg_type_number_t *service_namesCnt, bootstrap_status_array_t *service_active, mach_msg_type_number_t *service_activeCnt) { - return raw_bootstrap_info(bp, service_names, service_namesCnt, + return vproc_mig_info(bp, service_names, service_namesCnt, service_active, service_activeCnt); } @@ -288,7 +288,7 @@ return; } - if (raw_bootstrap_get_self(bootstrap_port, &bp_self) != 0) { + if (vproc_mig_get_self(bootstrap_port, &bp_self) != 0) { return; } Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 20:01:11 UTC (rev 22879) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:04:05 UTC (rev 22880) @@ -601,9 +601,9 @@ } /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ - mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); - if (x_bootstrap_subsystem.maxsize > mxmsgsz) { - mxmsgsz = x_bootstrap_subsystem.maxsize; + mxmsgsz = sizeof(union __RequestUnion__job_mig_bootstrap_subsystem); + if (job_mig_bootstrap_subsystem.maxsize > mxmsgsz) { + mxmsgsz = job_mig_bootstrap_subsystem.maxsize; } if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) { @@ -2847,9 +2847,9 @@ sprintf(j->label, "%d", MACH_PORT_INDEX(j->bs_port)); /* Sigh... at the moment, MIG has maxsize == sizeof(reply union) */ - mxmsgsz = sizeof(union __RequestUnion__x_bootstrap_subsystem); - if (x_bootstrap_subsystem.maxsize > mxmsgsz) { - mxmsgsz = x_bootstrap_subsystem.maxsize; + mxmsgsz = sizeof(union __RequestUnion__job_mig_bootstrap_subsystem); + if (job_mig_bootstrap_subsystem.maxsize > mxmsgsz) { + mxmsgsz = job_mig_bootstrap_subsystem.maxsize; } if (!job_assumes(j, runtime_add_mport(j->bs_port, bootstrap_server, mxmsgsz) == KERN_SUCCESS)) { Modified: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 20:01:11 UTC (rev 22879) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 21:04:05 UTC (rev 22880) @@ -145,7 +145,7 @@ } kern_return_t -x_bootstrap_create_server(job_t j, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, +job_mig_create_server(job_t j, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, audit_token_t au_tok, mach_port_t *server_portp) { struct ldcred ldc; @@ -185,7 +185,7 @@ } kern_return_t -x_bootstrap_getsocket(job_t j, name_t spr) +job_mig_getsocket(job_t j, name_t spr) { if (!sockpath) { return BOOTSTRAP_NO_MEMORY; @@ -199,7 +199,7 @@ } kern_return_t -x_bootstrap_get_self(job_t j, audit_token_t au_tok, mach_port_t *unprivportp) +job_mig_get_self(job_t j, audit_token_t au_tok, mach_port_t *unprivportp) { struct ldcred ldc; job_t j2; @@ -229,7 +229,7 @@ kern_return_t -x_bootstrap_check_in(job_t j, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) +job_mig_check_in(job_t j, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) { static pid_t last_warned_pid = 0; struct machservice *ms; @@ -266,7 +266,7 @@ } kern_return_t -x_bootstrap_register(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) +job_mig_register(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) { struct machservice *ms; struct ldcred ldc; @@ -315,7 +315,7 @@ } kern_return_t -x_bootstrap_look_up(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) +job_mig_look_up(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) { struct machservice *ms; struct ldcred ldc; @@ -345,7 +345,7 @@ } kern_return_t -x_bootstrap_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype) +job_mig_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype) { job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); @@ -365,7 +365,7 @@ } static void -x_bootstrap_info_countservices(struct machservice *ms, void *context) +job_mig_info_countservices(struct machservice *ms, void *context) { unsigned int *cnt = context; @@ -381,7 +381,7 @@ }; static void -x_bootstrap_info_copyservices(struct machservice *ms, void *context) +job_mig_info_copyservices(struct machservice *ms, void *context) { struct x_bootstrap_info_copyservices_cb *info_resp = context; @@ -399,7 +399,7 @@ } kern_return_t -x_bootstrap_info(job_t j, name_array_t *servicenamesp, unsigned int *servicenames_cnt, +job_mig_info(job_t j, name_array_t *servicenamesp, unsigned int *servicenames_cnt, bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) { struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; @@ -407,7 +407,7 @@ job_t ji; for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_countservices, &cnt, false); + job_foreach_service(ji, job_mig_info_countservices, &cnt, false); mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); if (!launchd_assumes(info_resp.service_names != NULL)) { @@ -420,7 +420,7 @@ } for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, x_bootstrap_info_copyservices, &info_resp, false); + job_foreach_service(ji, job_mig_info_copyservices, &info_resp, false); launchd_assumes(info_resp.i == cnt); @@ -442,7 +442,7 @@ } kern_return_t -x_bootstrap_transfer_subset(job_t j, mach_port_t *reqport, mach_port_t *rcvright, +job_mig_transfer_subset(job_t j, mach_port_t *reqport, mach_port_t *rcvright, name_array_t *servicenamesp, unsigned int *servicenames_cnt, vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, mach_port_array_t *ports, unsigned int *ports_cnt) @@ -460,7 +460,7 @@ job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); - job_foreach_service(j, x_bootstrap_info_countservices, &cnt, true); + job_foreach_service(j, job_mig_info_countservices, &cnt, true); mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); if (!launchd_assumes(info_resp.service_names != NULL)) { @@ -477,7 +477,7 @@ goto out_bad; } - job_foreach_service(j, x_bootstrap_info_copyservices, &info_resp, true); + job_foreach_service(j, job_mig_info_copyservices, &info_resp, true); launchd_assumes(info_resp.i == cnt); @@ -511,7 +511,7 @@ } kern_return_t -x_bootstrap_subset(job_t j, mach_port_t requestorport, mach_port_t *subsetportp) +job_mig_subset(job_t j, mach_port_t requestorport, mach_port_t *subsetportp) { int bsdepth = 0; job_t js = j; @@ -538,7 +538,7 @@ } kern_return_t -x_bootstrap_create_service(job_t j, name_t servicename, mach_port_t *serviceportp) +job_mig_create_service(job_t j, name_t servicename, mach_port_t *serviceportp) { struct machservice *ms; @@ -570,7 +570,7 @@ } kern_return_t -x_mpm_wait(job_t j, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) +job_mig_wait(job_t j, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) { #if 0 struct ldcred ldc; @@ -580,7 +580,7 @@ } kern_return_t -x_mpm_uncork_fork(job_t j, audit_token_t au_tok) +job_mig_uncork_fork(job_t j, audit_token_t au_tok) { if (!j) { return BOOTSTRAP_NOT_PRIVILEGED; @@ -592,7 +592,7 @@ } kern_return_t -x_mpm_spawn(job_t j, audit_token_t au_tok, +job_mig_spawn(job_t j, audit_token_t au_tok, _internal_string_t charbuf, mach_msg_type_number_t charbuf_cnt, uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, pid_t *child_pid, mach_port_t *obsvr_port) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060924/5a12711b/attachment.html From source_changes at macosforge.org Sun Sep 24 14:38:17 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22881] trunk/launchd/src Message-ID: <20060924213817.61615155012@cvs.opensource.apple.com> Revision: 22881 http://trac.macosforge.org/projects/launchd/changeset/22881 Author: zarzycki@apple.com Date: 2006-09-24 14:38:16 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Fold launchd_mach_ipc.c into launchd_core_logic.c. This isn't as bad as it sounds. MIG does nearly all of the hard Mach related IPC logic. It was actually more work in the long run to keep the artificial division. For the casual reader, the code that is in launchd_unix_ipc.c is automatically generated from MIG via the ".defs" file. I was surprised to see that launchd_mach_ipc.c was empty after the MIG callouts were folded into launchd_core_logic.c. In hindsight, that made sense. The rest of the Mach goo was folded into launchd_runtime.c. Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in trunk/launchd/src/launchd_core_logic.c Removed Paths: ------------- trunk/launchd/src/launchd_mach_ipc.c Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-24 21:04:05 UTC (rev 22880) +++ trunk/launchd/src/Makefile.am 2006-09-24 21:38:16 UTC (rev 22881) @@ -43,11 +43,10 @@ launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden launchd_LDFLAGS = -lbsm -launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c +launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c launchd_runtime.c:: notifyServer.h launchd_internal.h -launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h -launchd_core_logic.c:: bootstrap.h mpm_reply.h +launchd_core_logic.c:: bootstrap.h mpm_reply.h bootstrap.h bootstrapServer.h #launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h launchproxy_LDFLAGS = -weak_framework Security Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-24 21:04:05 UTC (rev 22880) +++ trunk/launchd/src/Makefile.in 2006-09-24 21:38:16 UTC (rev 22881) @@ -86,13 +86,12 @@ launchctl_OBJECTS = launchctl-launchctl.$(OBJEXT) launchctl_LDADD = $(LDADD) am__launchd_SOURCES_DIST = launchd.c launchd_core_logic.c \ - launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c \ - notifyServer.c launchd_internalUser.c launchd_internalServer.c \ + launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c \ + launchd_internalUser.c launchd_internalServer.c \ mpm_replyUser.c launchd_runtime.c @LIBS_ONLY_FALSE@am_launchd_OBJECTS = launchd-launchd.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_core_logic.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_unix_ipc.$(OBJEXT) \ -@LIBS_ONLY_FALSE@ launchd-launchd_mach_ipc.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-init.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-bootstrapServer.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-notifyServer.$(OBJEXT) \ @@ -240,7 +239,7 @@ @LIBS_ONLY_FALSE@SystemStarter_SOURCES = StartupItems.c IPC.c SystemStarter.c @LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden @LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm -@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c launchd_mach_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c +@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c #launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h @LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security @LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 @@ -430,7 +429,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_core_logic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalUser.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_mach_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_runtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_unix_ipc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-mpm_replyUser.Po@am__quote@ @@ -581,20 +579,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_unix_ipc.obj `if test -f 'launchd_unix_ipc.c'; then $(CYGPATH_W) 'launchd_unix_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_unix_ipc.c'; fi` -launchd-launchd_mach_ipc.o: launchd_mach_ipc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_mach_ipc.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" -c -o launchd-launchd_mach_ipc.o `test -f 'launchd_mach_ipc.c' || echo '$(srcdir)/'`launchd_mach_ipc.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" "$(DEPDIR)/launchd-launchd_mach_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.o `test -f 'launchd_mach_ipc.c' || echo '$(srcdir)/'`launchd_mach_ipc.c - -launchd-launchd_mach_ipc.obj: launchd_mach_ipc.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_mach_ipc.obj -MD -MP -MF "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" -c -o launchd-launchd_mach_ipc.obj `if test -f 'launchd_mach_ipc.c'; then $(CYGPATH_W) 'launchd_mach_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_mach_ipc.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo" "$(DEPDIR)/launchd-launchd_mach_ipc.Po"; else rm -f "$(DEPDIR)/launchd-launchd_mach_ipc.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='launchd_mach_ipc.c' object='launchd-launchd_mach_ipc.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_mach_ipc.obj `if test -f 'launchd_mach_ipc.c'; then $(CYGPATH_W) 'launchd_mach_ipc.c'; else $(CYGPATH_W) '$(srcdir)/launchd_mach_ipc.c'; fi` - launchd-init.o: init.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-init.o -MD -MP -MF "$(DEPDIR)/launchd-init.Tpo" -c -o launchd-init.o `test -f 'init.c' || echo '$(srcdir)/'`init.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-init.Tpo" "$(DEPDIR)/launchd-init.Po"; else rm -f "$(DEPDIR)/launchd-init.Tpo"; exit 1; fi @@ -1042,8 +1026,7 @@ @LIBS_ONLY_TRUE@ cp liblaunch_profile.a $(DESTDIR)/usr/local/lib/system/liblaunch_profile.a @LIBS_ONLY_FALSE@launchd_runtime.c:: notifyServer.h launchd_internal.h -@LIBS_ONLY_FALSE@launchd_mach_ipc.c:: bootstrap.h bootstrapServer.h -@LIBS_ONLY_FALSE@launchd_core_logic.c:: bootstrap.h mpm_reply.h +@LIBS_ONLY_FALSE@launchd_core_logic.c:: bootstrap.h mpm_reply.h bootstrap.h bootstrapServer.h @LIBS_ONLY_FALSE@notifyServer.c notifyServer.h: /usr/include/mach/notify.defs @LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -header /dev/null -user /dev/null -sheader notifyServer.h /usr/include/mach/notify.defs Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:04:05 UTC (rev 22880) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:38:16 UTC (rev 22881) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -75,6 +76,7 @@ #include "launchd_runtime.h" #include "launchd_core_logic.h" #include "launchd_unix_ipc.h" +#include "bootstrap_public.h" #include "bootstrap_private.h" #include "bootstrap.h" #include "bootstrapServer.h" @@ -83,6 +85,22 @@ #define LAUNCHD_MIN_JOB_RUN_TIME 10 #define LAUNCHD_ADVISABLE_IDLE_TIMEOUT 30 +static au_asid_t inherited_asid; +mach_port_t inherited_bootstrap_port; + +struct ldcred { + uid_t euid; + uid_t uid; + gid_t egid; + gid_t gid; + pid_t pid; + au_asid_t asid; +}; + +static void audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc); +static bool trusted_client_check(job_t j, struct ldcred *ldc); + + struct machservice { SLIST_ENTRY(machservice) sle; job_t job; @@ -3423,3 +3441,610 @@ return true; } + +kern_return_t +job_mig_create_server(job_t j, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, + audit_token_t au_tok, mach_port_t *server_portp) +{ + struct ldcred ldc; + job_t js; + + audit_token_to_launchd_cred(au_tok, &ldc); + + job_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); + +#define LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 + /* XXX - This code should go away once the per session launchd is integrated with the rest of the system */ + #ifdef LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 + if (getpid() == 1) { + if (ldc.euid != 0 && ldc.euid != server_uid) { + job_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", + server_cmd, ldc.euid, server_uid); + server_uid = ldc.euid; + } + } else +#endif + if (!trusted_client_check(j, &ldc)) { + return BOOTSTRAP_NOT_PRIVILEGED; + } else if (server_uid != getuid()) { + job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", + server_cmd, getuid(), server_uid); + server_uid = getuid(); + } + + js = job_new_via_mach_init(j, server_cmd, server_uid, on_demand); + + if (js == NULL) { + return BOOTSTRAP_NO_MEMORY; + } + + *server_portp = job_get_bsport(js); + return BOOTSTRAP_SUCCESS; +} + +kern_return_t +job_mig_getsocket(job_t j, name_t spr) +{ + if (!sockpath) { + return BOOTSTRAP_NO_MEMORY; + } else if (getpid() == 1) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + + strncpy(spr, sockpath, sizeof(name_t)); + + return BOOTSTRAP_SUCCESS; +} + +kern_return_t +job_mig_get_self(job_t j, audit_token_t au_tok, mach_port_t *unprivportp) +{ + struct ldcred ldc; + job_t j2; + + audit_token_to_launchd_cred(au_tok, &ldc); + + job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); + + j2 = job_find_by_pid(j, ldc.pid, false); + + if (!j2) { + if (ldc.uid == getuid() && ldc.euid == geteuid()) { + j2 = job_new_anonymous(j, ldc.pid); + if (!j2) { + return BOOTSTRAP_NO_MEMORY; + } + } else { + job_log(j, LOG_NOTICE, "PID %u not managed by launchd", ldc.pid); + return BOOTSTRAP_NOT_PRIVILEGED; + } + } + + *unprivportp = job_get_bsport(j2); + + return BOOTSTRAP_SUCCESS; +} + + +kern_return_t +job_mig_check_in(job_t j, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) +{ + static pid_t last_warned_pid = 0; + struct machservice *ms; + struct ldcred ldc; + + audit_token_to_launchd_cred(au_tok, &ldc); + + ms = job_lookup_service(j, servicename, true); + + if (ms == NULL) { + job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); + return BOOTSTRAP_UNKNOWN_SERVICE; + } + if (machservice_job(ms) != j) { + if (last_warned_pid != ldc.pid) { + job_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", + ldc.pid, servicename); + last_warned_pid = ldc.pid; + } + return BOOTSTRAP_NOT_PRIVILEGED; + } + if (machservice_active(ms)) { + job_log(j, LOG_WARNING, "Check-in of Mach service failed. Already active: %s", servicename); + return BOOTSTRAP_SERVICE_ACTIVE; + } + + machservice_watch(ms); + + job_log(j, LOG_INFO, "Check-in of service: %s", servicename); + + *serviceportp = machservice_port(ms); + return BOOTSTRAP_SUCCESS; +} + +kern_return_t +job_mig_register(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) +{ + struct machservice *ms; + struct ldcred ldc; + job_t j2; + + audit_token_to_launchd_cred(au_tok, &ldc); + + if (j == job_get_bs(j)) { + j2 = job_find_by_pid(j, ldc.pid, false); + if (!j2) { + j2 = job_new_anonymous(j, ldc.pid); + } + if (j2) { + j = j2; + } + } + + job_log(j, LOG_NOTICE, "bootstrap_register() is deprecated. PID: %u Service: %s", ldc.pid, servicename); + + job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); + + ms = job_lookup_service(j, servicename, false); + + if (ms) { + if (machservice_job(ms) != j) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + if (machservice_active(ms)) { + job_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); + return BOOTSTRAP_SERVICE_ACTIVE; + } + job_checkin(machservice_job(ms)); + machservice_delete(ms); + } + + if (serviceport != MACH_PORT_NULL) { + if ((ms = machservice_new(j, servicename, &serviceport))) { + machservice_watch(ms); + } else { + return BOOTSTRAP_NO_MEMORY; + } + } + + return BOOTSTRAP_SUCCESS; +} + +kern_return_t +job_mig_look_up(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) +{ + struct machservice *ms; + struct ldcred ldc; + + audit_token_to_launchd_cred(au_tok, &ldc); + + ms = job_lookup_service(j, servicename, true); + + if (ms && machservice_hidden(ms) && !job_active(machservice_job(ms))) { + ms = NULL; + } + + if (ms) { + launchd_assumes(machservice_port(ms) != MACH_PORT_NULL); + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); + *serviceportp = machservice_port(ms); + *ptype = MACH_MSG_TYPE_COPY_SEND; + return BOOTSTRAP_SUCCESS; + } else if (inherited_bootstrap_port != MACH_PORT_NULL) { + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); + *ptype = MACH_MSG_TYPE_MOVE_SEND; + return bootstrap_look_up(inherited_bootstrap_port, servicename, serviceportp); + } else { + job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); + return BOOTSTRAP_UNKNOWN_SERVICE; + } +} + +kern_return_t +job_mig_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype) +{ + job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); + + j = job_get_bs(j); + + *pptype = MACH_MSG_TYPE_MAKE_SEND; + + if (job_parent(j)) { + *parentport = job_get_bsport(job_parent(j)); + } else if (MACH_PORT_NULL == inherited_bootstrap_port) { + *parentport = job_get_bsport(j); + } else { + *pptype = MACH_MSG_TYPE_COPY_SEND; + *parentport = inherited_bootstrap_port; + } + return BOOTSTRAP_SUCCESS; +} + +static void +job_mig_info_countservices(struct machservice *ms, void *context) +{ + unsigned int *cnt = context; + + (*cnt)++; +} + +struct x_bootstrap_info_copyservices_cb { + name_array_t service_names; + bootstrap_status_array_t service_actives; + mach_port_array_t ports; + pid_t *pids; + unsigned int i; +}; + +static void +job_mig_info_copyservices(struct machservice *ms, void *context) +{ + struct x_bootstrap_info_copyservices_cb *info_resp = context; + + strlcpy(info_resp->service_names[info_resp->i], machservice_name(ms), sizeof(info_resp->service_names[0])); + + launchd_assumes(info_resp->service_actives || info_resp->ports); + + if (info_resp->service_actives) { + info_resp->service_actives[info_resp->i] = machservice_status(ms); + } else { + info_resp->ports[info_resp->i] = machservice_port(ms); + info_resp->pids[info_resp->i] = job_get_pid(machservice_job(ms)); + } + info_resp->i++; +} + +kern_return_t +job_mig_info(job_t j, name_array_t *servicenamesp, unsigned int *servicenames_cnt, + bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) +{ + struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; + unsigned int cnt = 0; + job_t ji; + + for (ji = j; ji; ji = job_parent(ji)) + job_foreach_service(ji, job_mig_info_countservices, &cnt, false); + + mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (!launchd_assumes(info_resp.service_names != NULL)) { + goto out_bad; + } + + mig_allocate((vm_address_t *)&info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); + if (!launchd_assumes(info_resp.service_actives != NULL)) { + goto out_bad; + } + + for (ji = j; ji; ji = job_parent(ji)) + job_foreach_service(ji, job_mig_info_copyservices, &info_resp, false); + + launchd_assumes(info_resp.i == cnt); + + *servicenamesp = info_resp.service_names; + *serviceactivesp = info_resp.service_actives; + *servicenames_cnt = *serviceactives_cnt = cnt; + + return BOOTSTRAP_SUCCESS; + +out_bad: + if (info_resp.service_names) { + mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + } + if (info_resp.service_actives) { + mig_deallocate((vm_address_t)info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); + } + + return BOOTSTRAP_NO_MEMORY; +} + +kern_return_t +job_mig_transfer_subset(job_t j, mach_port_t *reqport, mach_port_t *rcvright, + name_array_t *servicenamesp, unsigned int *servicenames_cnt, + vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, + mach_port_array_t *ports, unsigned int *ports_cnt) +{ + struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; + unsigned int cnt = 0; + + if (getpid() != 1) { + job_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); + return BOOTSTRAP_NOT_PRIVILEGED; + } else if (!job_parent(j)) { + job_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); + return BOOTSTRAP_NOT_PRIVILEGED; + } + + job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); + + job_foreach_service(j, job_mig_info_countservices, &cnt, true); + + mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + if (!launchd_assumes(info_resp.service_names != NULL)) { + goto out_bad; + } + + mig_allocate((vm_address_t *)&info_resp.ports, cnt * sizeof(info_resp.ports[0])); + if (!launchd_assumes(info_resp.ports != NULL)) { + goto out_bad; + } + + mig_allocate((vm_address_t *)&info_resp.pids, cnt * sizeof(pid_t)); + if (!launchd_assumes(info_resp.pids != NULL)) { + goto out_bad; + } + + job_foreach_service(j, job_mig_info_copyservices, &info_resp, true); + + launchd_assumes(info_resp.i == cnt); + + *servicenamesp = info_resp.service_names; + *ports = info_resp.ports; + *servicenames_cnt = *ports_cnt = cnt; + *service_pids = (vm_offset_t)info_resp.pids; + *service_pidsCnt = cnt * sizeof(pid_t); + + *reqport = job_get_reqport(j); + *rcvright = job_get_bsport(j); + + launchd_assumes(runtime_remove_mport(*rcvright) == KERN_SUCCESS); + + launchd_assumes(launchd_mport_make_send(*rcvright) == KERN_SUCCESS); + + return BOOTSTRAP_SUCCESS; + +out_bad: + if (info_resp.service_names) { + mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); + } + if (info_resp.ports) { + mig_deallocate((vm_address_t)info_resp.ports, cnt * sizeof(info_resp.ports[0])); + } + if (info_resp.pids) { + mig_deallocate((vm_address_t)info_resp.pids, cnt * sizeof(pid_t)); + } + + return BOOTSTRAP_NO_MEMORY; +} + +kern_return_t +job_mig_subset(job_t j, mach_port_t requestorport, mach_port_t *subsetportp) +{ + int bsdepth = 0; + job_t js = j; + + while ((js = job_parent(js)) != NULL) { + bsdepth++; + } + + /* Since we use recursion, we need an artificial depth for subsets */ + if (bsdepth > 100) { + job_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); + return BOOTSTRAP_NO_MEMORY; + } + + if ((js = job_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { + if (requestorport == MACH_PORT_NULL) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + return BOOTSTRAP_NO_MEMORY; + } + + *subsetportp = job_get_bsport(js); + return BOOTSTRAP_SUCCESS; +} + +kern_return_t +job_mig_create_service(job_t j, name_t servicename, mach_port_t *serviceportp) +{ + struct machservice *ms; + + if (job_prog(j)[0] == '\0') { + job_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); + return BOOTSTRAP_NOT_PRIVILEGED; + } + + ms = job_lookup_service(j, servicename, false); + if (ms) { + job_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); + return BOOTSTRAP_NAME_IN_USE; + } + + job_checkin(j); + + *serviceportp = MACH_PORT_NULL; + ms = machservice_new(j, servicename, serviceportp); + + if (!launchd_assumes(ms != NULL)) { + goto out_bad; + } + + return BOOTSTRAP_SUCCESS; + +out_bad: + launchd_assumes(launchd_mport_close_recv(*serviceportp) == KERN_SUCCESS); + return BOOTSTRAP_NO_MEMORY; +} + +kern_return_t +job_mig_wait(job_t j, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) +{ +#if 0 + struct ldcred ldc; + audit_token_to_launchd_cred(au_tok, &ldc); +#endif + return job_handle_mpm_wait(j, srp, waitstatus); +} + +kern_return_t +job_mig_uncork_fork(job_t j, audit_token_t au_tok) +{ + if (!j) { + return BOOTSTRAP_NOT_PRIVILEGED; + } + + job_uncork_fork(j); + + return 0; +} + +kern_return_t +job_mig_spawn(job_t j, audit_token_t au_tok, + _internal_string_t charbuf, mach_msg_type_number_t charbuf_cnt, + uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, + pid_t *child_pid, mach_port_t *obsvr_port) +{ + job_t jr; + struct ldcred ldc; + size_t offset = 0; + char *tmpp; + const char **argv = NULL, **env = NULL; + const char *label = NULL; + const char *path = NULL; + const char *workingdir = NULL; + size_t argv_i = 0, env_i = 0; + + audit_token_to_launchd_cred(au_tok, &ldc); + +#if 0 + if (ldc.asid != inherited_asid) { + job_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", + ldc.pid, ldc.asid, inherited_asid); + return BOOTSTRAP_NOT_PRIVILEGED; + } +#endif + + argv = alloca((argc + 1) * sizeof(char *)); + memset(argv, 0, (argc + 1) * sizeof(char *)); + + if (envc > 0) { + env = alloca((envc + 1) * sizeof(char *)); + memset(env, 0, (envc + 1) * sizeof(char *)); + } + + while (offset < charbuf_cnt) { + tmpp = charbuf + offset; + offset += strlen(tmpp) + 1; + if (!label) { + label = tmpp; + } else if (argc > 0) { + argv[argv_i] = tmpp; + argv_i++; + argc--; + } else if (envc > 0) { + env[env_i] = tmpp; + env_i++; + envc--; + } else if (flags & SPAWN_HAS_PATH) { + path = tmpp; + flags &= ~SPAWN_HAS_PATH; + } else if (flags & SPAWN_HAS_WDIR) { + workingdir = tmpp; + flags &= ~SPAWN_HAS_WDIR; + } + } + + jr = job_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, + flags & SPAWN_WANTS_WAIT4DEBUGGER, flags & SPAWN_WANTS_FORCE_PPC); + + if (jr == NULL) switch (errno) { + case EEXIST: + return BOOTSTRAP_NAME_IN_USE; + default: + return BOOTSTRAP_NO_MEMORY; + } + + job_log(j, LOG_INFO, "Spawned with flags:%s%s", + flags & SPAWN_WANTS_FORCE_PPC ? " ppc": "", + flags & SPAWN_WANTS_WAIT4DEBUGGER ? " stopped": ""); + + *child_pid = job_get_pid(jr); + *obsvr_port = job_get_bsport(jr); + + return BOOTSTRAP_SUCCESS; +} + +void +audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc) +{ + audit_token_to_au32(au_tok, /* audit UID */ NULL, &ldc->euid, + &ldc->egid, &ldc->uid, &ldc->gid, &ldc->pid, + &ldc->asid, /* au_tid_t */ NULL); +} + +bool +trusted_client_check(job_t j, struct ldcred *ldc) +{ + static pid_t last_warned_pid = 0; + + /* + * In the long run, we wish to enforce the progeny rule, but for now, + * we'll let root and the user be forgiven. Once we get CoreProcesses + * to switch to using launchd rather than the WindowServer for indirect + * process invocation, we can then seriously look at cranking up the + * warning level here. + */ + + if (inherited_asid == ldc->asid) { + return true; + } + if (progeny_check(ldc->pid)) { + return true; + } + if (ldc->euid == geteuid()) { + return true; + } + if (ldc->euid == 0 && ldc->uid == 0) { + return true; + } + if (last_warned_pid == ldc->pid) { + return false; + } + + job_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); + + last_warned_pid = ldc->pid; + + return false; +} + +void +mach_init_init(mach_port_t req_port, mach_port_t checkin_port, + name_array_t l2l_names, mach_port_array_t l2l_ports, pid_t *l2l_pids, mach_msg_type_number_t l2l_cnt) +{ + mach_msg_type_number_t l2l_i; + auditinfo_t inherited_audit; + job_t anon_job; + + getaudit(&inherited_audit); + inherited_asid = inherited_audit.ai_asid; + + launchd_assert((root_job = job_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); + + launchd_assert(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); + + if (getpid() != 1) { + launchd_assumes(inherited_bootstrap_port != MACH_PORT_NULL); + } + + /* We set this explicitly as we start each child */ + launchd_assert(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); + + /* cut off the Libc cache, we don't want to deadlock against ourself */ + bootstrap_port = MACH_PORT_NULL; + + if (l2l_names == NULL) { + return; + } + + for (l2l_i = 0; l2l_i < l2l_cnt; l2l_i++) { + struct machservice *ms; + + if (!(anon_job = job_find_by_pid(root_job, l2l_pids[l2l_i], false))) { + launchd_assert(anon_job = job_new_anonymous(root_job, l2l_pids[l2l_i])); + } + + if ((ms = machservice_new(anon_job, l2l_names[l2l_i], &l2l_ports[l2l_i]))) { + machservice_watch(ms); + } + } +} Deleted: trunk/launchd/src/launchd_mach_ipc.c =================================================================== --- trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 21:04:05 UTC (rev 22880) +++ trunk/launchd/src/launchd_mach_ipc.c 2006-09-24 21:38:16 UTC (rev 22881) @@ -1,703 +0,0 @@ -/* - * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ -/* - * bootstrap -- fundamental service initiator and port server - * Mike DeMoney, NeXT, Inc. - * Copyright, 1990. All rights reserved. - * - * bootstrap.c -- implementation of bootstrap main service loop - */ - -static const char *const __rcs_file_version__ = "$Revision$"; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "launchd_core_logic.h" -#include "bootstrap_public.h" -#include "bootstrap_private.h" -#include "bootstrap.h" -#include "bootstrapServer.h" -#include "launchd.h" -#include "launchd_runtime.h" -#include "launch_priv.h" -#include "launchd_unix_ipc.h" - -struct ldcred { - uid_t euid; - uid_t uid; - gid_t egid; - gid_t gid; - pid_t pid; - au_asid_t asid; -}; - -static au_asid_t inherited_asid = 0; - -static bool canReceive(mach_port_t); -static void audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc); - -mach_port_t inherited_bootstrap_port = MACH_PORT_NULL; - -static bool trusted_client_check(job_t j, struct ldcred *ldc); - -void -mach_init_init(mach_port_t req_port, mach_port_t checkin_port, - name_array_t l2l_names, mach_port_array_t l2l_ports, pid_t *l2l_pids, mach_msg_type_number_t l2l_cnt) -{ - mach_msg_type_number_t l2l_i; - auditinfo_t inherited_audit; - job_t anon_job; - - getaudit(&inherited_audit); - inherited_asid = inherited_audit.ai_asid; - - launchd_assert((root_job = job_new_bootstrap(NULL, req_port ? req_port : mach_task_self(), checkin_port)) != NULL); - - launchd_assumes(launchd_get_bport(&inherited_bootstrap_port) == KERN_SUCCESS); - - if (getpid() != 1) { - launchd_assumes(inherited_bootstrap_port != MACH_PORT_NULL); - } - - /* We set this explicitly as we start each child */ - launchd_assumes(launchd_set_bport(MACH_PORT_NULL) == KERN_SUCCESS); - - /* cut off the Libc cache, we don't want to deadlock against ourself */ - bootstrap_port = MACH_PORT_NULL; - - if (l2l_names == NULL) { - return; - } - - for (l2l_i = 0; l2l_i < l2l_cnt; l2l_i++) { - struct machservice *ms; - - if (!(anon_job = job_find_by_pid(root_job, l2l_pids[l2l_i], false))) { - launchd_assert(anon_job = job_new_anonymous(root_job, l2l_pids[l2l_i])); - } - - if ((ms = machservice_new(anon_job, l2l_names[l2l_i], &l2l_ports[l2l_i]))) { - machservice_watch(ms); - } - } -} - -bool -canReceive(mach_port_t port) -{ - mach_port_type_t p_type; - - if (!launchd_assumes(mach_port_type(mach_task_self(), port, &p_type) == KERN_SUCCESS)) { - return false; - } - - return ((p_type & MACH_PORT_TYPE_RECEIVE) != 0); -} - -void -audit_token_to_launchd_cred(audit_token_t au_tok, struct ldcred *ldc) -{ - audit_token_to_au32(au_tok, /* audit UID */ NULL, - &ldc->euid, &ldc->egid, - &ldc->uid, &ldc->gid, &ldc->pid, - &ldc->asid, /* au_tid_t */ NULL); -} - -kern_return_t -job_mig_create_server(job_t j, cmd_t server_cmd, uid_t server_uid, boolean_t on_demand, - audit_token_t au_tok, mach_port_t *server_portp) -{ - struct ldcred ldc; - job_t js; - - audit_token_to_launchd_cred(au_tok, &ldc); - - job_log(j, LOG_DEBUG, "Server create attempt: %s", server_cmd); - -#define LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 - /* XXX - This code should go away once the per session launchd is integrated with the rest of the system */ - #ifdef LET_MERE_MORTALS_ADD_SERVERS_TO_PID1 - if (getpid() == 1) { - if (ldc.euid != 0 && ldc.euid != server_uid) { - job_log(j, LOG_WARNING, "Server create: \"%s\": Will run as UID %d, not UID %d as they told us to", - server_cmd, ldc.euid, server_uid); - server_uid = ldc.euid; - } - } else -#endif - if (!trusted_client_check(j, &ldc)) { - return BOOTSTRAP_NOT_PRIVILEGED; - } else if (server_uid != getuid()) { - job_log(j, LOG_WARNING, "Server create: \"%s\": As UID %d, we will not be able to switch to UID %d", - server_cmd, getuid(), server_uid); - server_uid = getuid(); - } - - js = job_new_via_mach_init(j, server_cmd, server_uid, on_demand); - - if (js == NULL) { - return BOOTSTRAP_NO_MEMORY; - } - - *server_portp = job_get_bsport(js); - return BOOTSTRAP_SUCCESS; -} - -kern_return_t -job_mig_getsocket(job_t j, name_t spr) -{ - if (!sockpath) { - return BOOTSTRAP_NO_MEMORY; - } else if (getpid() == 1) { - return BOOTSTRAP_NOT_PRIVILEGED; - } - - strncpy(spr, sockpath, sizeof(name_t)); - - return BOOTSTRAP_SUCCESS; -} - -kern_return_t -job_mig_get_self(job_t j, audit_token_t au_tok, mach_port_t *unprivportp) -{ - struct ldcred ldc; - job_t j2; - - audit_token_to_launchd_cred(au_tok, &ldc); - - job_log(j, LOG_DEBUG, "Requested unprivileged bootstrap port"); - - j2 = job_find_by_pid(j, ldc.pid, false); - - if (!j2) { - if (ldc.uid == getuid() && ldc.euid == geteuid()) { - j2 = job_new_anonymous(j, ldc.pid); - if (!j2) { - return BOOTSTRAP_NO_MEMORY; - } - } else { - job_log(j, LOG_NOTICE, "PID %u not managed by launchd", ldc.pid); - return BOOTSTRAP_NOT_PRIVILEGED; - } - } - - *unprivportp = job_get_bsport(j2); - - return BOOTSTRAP_SUCCESS; -} - - -kern_return_t -job_mig_check_in(job_t j, name_t servicename, audit_token_t au_tok, mach_port_t *serviceportp) -{ - static pid_t last_warned_pid = 0; - struct machservice *ms; - struct ldcred ldc; - - audit_token_to_launchd_cred(au_tok, &ldc); - - ms = job_lookup_service(j, servicename, true); - - if (ms == NULL) { - job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Unknown: %s", servicename); - return BOOTSTRAP_UNKNOWN_SERVICE; - } - if (machservice_job(ms) != j) { - if (last_warned_pid != ldc.pid) { - job_log(j, LOG_NOTICE, "Check-in of Mach service failed. PID %d is not privileged: %s", - ldc.pid, servicename); - last_warned_pid = ldc.pid; - } - return BOOTSTRAP_NOT_PRIVILEGED; - } - if (!canReceive(machservice_port(ms))) { - launchd_assumes(machservice_active(ms)); - job_log(j, LOG_DEBUG, "Check-in of Mach service failed. Already active: %s", servicename); - return BOOTSTRAP_SERVICE_ACTIVE; - } - - machservice_watch(ms); - - job_log(j, LOG_INFO, "Check-in of service: %s", servicename); - - *serviceportp = machservice_port(ms); - return BOOTSTRAP_SUCCESS; -} - -kern_return_t -job_mig_register(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t serviceport) -{ - struct machservice *ms; - struct ldcred ldc; - job_t j2; - - audit_token_to_launchd_cred(au_tok, &ldc); - - if (j == job_get_bs(j)) { - j2 = job_find_by_pid(j, ldc.pid, false); - if (!j2) { - j2 = job_new_anonymous(j, ldc.pid); - } - if (j2) { - j = j2; - } - } - - job_log(j, LOG_NOTICE, "bootstrap_register() is deprecated. PID: %u Service: %s", ldc.pid, servicename); - - job_log(j, LOG_DEBUG, "Mach service registration attempt: %s", servicename); - - ms = job_lookup_service(j, servicename, false); - - if (ms) { - if (machservice_job(ms) != j) { - return BOOTSTRAP_NOT_PRIVILEGED; - } - if (machservice_active(ms)) { - job_log(j, LOG_DEBUG, "Mach service registration failed. Already active: %s", servicename); - launchd_assumes(!canReceive(machservice_port(ms))); - return BOOTSTRAP_SERVICE_ACTIVE; - } - job_checkin(machservice_job(ms)); - machservice_delete(ms); - } - - if (serviceport != MACH_PORT_NULL) { - if ((ms = machservice_new(j, servicename, &serviceport))) { - machservice_watch(ms); - } else { - return BOOTSTRAP_NO_MEMORY; - } - } - - return BOOTSTRAP_SUCCESS; -} - -kern_return_t -job_mig_look_up(job_t j, audit_token_t au_tok, name_t servicename, mach_port_t *serviceportp, mach_msg_type_name_t *ptype) -{ - struct machservice *ms; - struct ldcred ldc; - - audit_token_to_launchd_cred(au_tok, &ldc); - - ms = job_lookup_service(j, servicename, true); - - if (ms && machservice_hidden(ms) && !job_active(machservice_job(ms))) { - ms = NULL; - } - - if (ms) { - launchd_assumes(machservice_port(ms) != MACH_PORT_NULL); - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d): %s", ldc.pid, servicename); - *serviceportp = machservice_port(ms); - *ptype = MACH_MSG_TYPE_COPY_SEND; - return BOOTSTRAP_SUCCESS; - } else if (inherited_bootstrap_port != MACH_PORT_NULL) { - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) forwarded: %s", ldc.pid, servicename); - *ptype = MACH_MSG_TYPE_MOVE_SEND; - return bootstrap_look_up(inherited_bootstrap_port, servicename, serviceportp); - } else { - job_log(j, LOG_DEBUG, "Mach service lookup (by PID %d) failed: %s", ldc.pid, servicename); - return BOOTSTRAP_UNKNOWN_SERVICE; - } -} - -kern_return_t -job_mig_parent(job_t j, mach_port_t *parentport, mach_msg_type_name_t *pptype) -{ - job_log(j, LOG_DEBUG, "Requested parent bootstrap port"); - - j = job_get_bs(j); - - *pptype = MACH_MSG_TYPE_MAKE_SEND; - - if (job_parent(j)) { - *parentport = job_get_bsport(job_parent(j)); - } else if (MACH_PORT_NULL == inherited_bootstrap_port) { - *parentport = job_get_bsport(j); - } else { - *pptype = MACH_MSG_TYPE_COPY_SEND; - *parentport = inherited_bootstrap_port; - } - return BOOTSTRAP_SUCCESS; -} - -static void -job_mig_info_countservices(struct machservice *ms, void *context) -{ - unsigned int *cnt = context; - - (*cnt)++; -} - -struct x_bootstrap_info_copyservices_cb { - name_array_t service_names; - bootstrap_status_array_t service_actives; - mach_port_array_t ports; - pid_t *pids; - unsigned int i; -}; - -static void -job_mig_info_copyservices(struct machservice *ms, void *context) -{ - struct x_bootstrap_info_copyservices_cb *info_resp = context; - - strlcpy(info_resp->service_names[info_resp->i], machservice_name(ms), sizeof(info_resp->service_names[0])); - - launchd_assumes(info_resp->service_actives || info_resp->ports); - - if (info_resp->service_actives) { - info_resp->service_actives[info_resp->i] = machservice_status(ms); - } else { - info_resp->ports[info_resp->i] = machservice_port(ms); - info_resp->pids[info_resp->i] = job_get_pid(machservice_job(ms)); - } - info_resp->i++; -} - -kern_return_t -job_mig_info(job_t j, name_array_t *servicenamesp, unsigned int *servicenames_cnt, - bootstrap_status_array_t *serviceactivesp, unsigned int *serviceactives_cnt) -{ - struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; - unsigned int cnt = 0; - job_t ji; - - for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, job_mig_info_countservices, &cnt, false); - - mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - if (!launchd_assumes(info_resp.service_names != NULL)) { - goto out_bad; - } - - mig_allocate((vm_address_t *)&info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); - if (!launchd_assumes(info_resp.service_actives != NULL)) { - goto out_bad; - } - - for (ji = j; ji; ji = job_parent(ji)) - job_foreach_service(ji, job_mig_info_copyservices, &info_resp, false); - - launchd_assumes(info_resp.i == cnt); - - *servicenamesp = info_resp.service_names; - *serviceactivesp = info_resp.service_actives; - *servicenames_cnt = *serviceactives_cnt = cnt; - - return BOOTSTRAP_SUCCESS; - -out_bad: - if (info_resp.service_names) { - mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - } - if (info_resp.service_actives) { - mig_deallocate((vm_address_t)info_resp.service_actives, cnt * sizeof(info_resp.service_actives[0])); - } - - return BOOTSTRAP_NO_MEMORY; -} - -kern_return_t -job_mig_transfer_subset(job_t j, mach_port_t *reqport, mach_port_t *rcvright, - name_array_t *servicenamesp, unsigned int *servicenames_cnt, - vm_offset_t *service_pids, mach_msg_type_number_t *service_pidsCnt, - mach_port_array_t *ports, unsigned int *ports_cnt) -{ - struct x_bootstrap_info_copyservices_cb info_resp = { NULL, NULL, NULL, NULL, 0 }; - unsigned int cnt = 0; - - if (getpid() != 1) { - job_log(j, LOG_ERR, "Only the system launchd will transfer Mach sub-bootstraps."); - return BOOTSTRAP_NOT_PRIVILEGED; - } else if (!job_parent(j)) { - job_log(j, LOG_ERR, "Root Mach bootstrap cannot be transferred."); - return BOOTSTRAP_NOT_PRIVILEGED; - } - - job_log(j, LOG_DEBUG, "Transferring sub-bootstrap to the per session launchd."); - - job_foreach_service(j, job_mig_info_countservices, &cnt, true); - - mig_allocate((vm_address_t *)&info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - if (!launchd_assumes(info_resp.service_names != NULL)) { - goto out_bad; - } - - mig_allocate((vm_address_t *)&info_resp.ports, cnt * sizeof(info_resp.ports[0])); - if (!launchd_assumes(info_resp.ports != NULL)) { - goto out_bad; - } - - mig_allocate((vm_address_t *)&info_resp.pids, cnt * sizeof(pid_t)); - if (!launchd_assumes(info_resp.pids != NULL)) { - goto out_bad; - } - - job_foreach_service(j, job_mig_info_copyservices, &info_resp, true); - - launchd_assumes(info_resp.i == cnt); - - *servicenamesp = info_resp.service_names; - *ports = info_resp.ports; - *servicenames_cnt = *ports_cnt = cnt; - *service_pids = (vm_offset_t)info_resp.pids; - *service_pidsCnt = cnt * sizeof(pid_t); - - *reqport = job_get_reqport(j); - *rcvright = job_get_bsport(j); - - launchd_assumes(runtime_remove_mport(*rcvright) == KERN_SUCCESS); - - launchd_assumes(launchd_mport_make_send(*rcvright) == KERN_SUCCESS); - - return BOOTSTRAP_SUCCESS; - -out_bad: - if (info_resp.service_names) { - mig_deallocate((vm_address_t)info_resp.service_names, cnt * sizeof(info_resp.service_names[0])); - } - if (info_resp.ports) { - mig_deallocate((vm_address_t)info_resp.ports, cnt * sizeof(info_resp.ports[0])); - } - if (info_resp.pids) { - mig_deallocate((vm_address_t)info_resp.pids, cnt * sizeof(pid_t)); - } - - return BOOTSTRAP_NO_MEMORY; -} - -kern_return_t -job_mig_subset(job_t j, mach_port_t requestorport, mach_port_t *subsetportp) -{ - int bsdepth = 0; - job_t js = j; - - while ((js = job_parent(js)) != NULL) { - bsdepth++; - } - - /* Since we use recursion, we need an artificial depth for subsets */ - if (bsdepth > 100) { - job_log(j, LOG_ERR, "Mach sub-bootstrap create request failed. Depth greater than: %d", bsdepth); - return BOOTSTRAP_NO_MEMORY; - } - - if ((js = job_new_bootstrap(j, requestorport, MACH_PORT_NULL)) == NULL) { - if (requestorport == MACH_PORT_NULL) { - return BOOTSTRAP_NOT_PRIVILEGED; - } - return BOOTSTRAP_NO_MEMORY; - } - - *subsetportp = job_get_bsport(js); - return BOOTSTRAP_SUCCESS; -} - -kern_return_t -job_mig_create_service(job_t j, name_t servicename, mach_port_t *serviceportp) -{ - struct machservice *ms; - - if (job_prog(j)[0] == '\0') { - job_log(j, LOG_ERR, "Mach service creation requires a target server: %s", servicename); - return BOOTSTRAP_NOT_PRIVILEGED; - } - - ms = job_lookup_service(j, servicename, false); - if (ms) { - job_log(j, LOG_DEBUG, "Mach service creation attempt for failed. Already exists: %s", servicename); - return BOOTSTRAP_NAME_IN_USE; - } - - job_checkin(j); - - *serviceportp = MACH_PORT_NULL; - ms = machservice_new(j, servicename, serviceportp); - - if (!launchd_assumes(ms != NULL)) { - goto out_bad; - } - - return BOOTSTRAP_SUCCESS; - -out_bad: - launchd_assumes(launchd_mport_close_recv(*serviceportp) == KERN_SUCCESS); - return BOOTSTRAP_NO_MEMORY; -} - -kern_return_t -job_mig_wait(job_t j, mach_port_t srp, audit_token_t au_tok, integer_t *waitstatus) -{ -#if 0 - struct ldcred ldc; - audit_token_to_launchd_cred(au_tok, &ldc); -#endif - return job_handle_mpm_wait(j, srp, waitstatus); -} - -kern_return_t -job_mig_uncork_fork(job_t j, audit_token_t au_tok) -{ - if (!j) { - return BOOTSTRAP_NOT_PRIVILEGED; - } - - job_uncork_fork(j); - - return 0; -} - -kern_return_t -job_mig_spawn(job_t j, audit_token_t au_tok, - _internal_string_t charbuf, mach_msg_type_number_t charbuf_cnt, - uint32_t argc, uint32_t envc, uint64_t flags, uint16_t mig_umask, - pid_t *child_pid, mach_port_t *obsvr_port) -{ - job_t jr; - struct ldcred ldc; - size_t offset = 0; - char *tmpp; - const char **argv = NULL, **env = NULL; - const char *label = NULL; - const char *path = NULL; - const char *workingdir = NULL; - size_t argv_i = 0, env_i = 0; - - audit_token_to_launchd_cred(au_tok, &ldc); - -#if 0 - if (ldc.asid != inherited_asid) { - job_log(j, LOG_ERR, "Security: PID %d (ASID %d) was denied a request to spawn a process in this session (ASID %d)", - ldc.pid, ldc.asid, inherited_asid); - return BOOTSTRAP_NOT_PRIVILEGED; - } -#endif - - argv = alloca((argc + 1) * sizeof(char *)); - memset(argv, 0, (argc + 1) * sizeof(char *)); - - if (envc > 0) { - env = alloca((envc + 1) * sizeof(char *)); - memset(env, 0, (envc + 1) * sizeof(char *)); - } - - while (offset < charbuf_cnt) { - tmpp = charbuf + offset; - offset += strlen(tmpp) + 1; - if (!label) { - label = tmpp; - } else if (argc > 0) { - argv[argv_i] = tmpp; - argv_i++; - argc--; - } else if (envc > 0) { - env[env_i] = tmpp; - env_i++; - envc--; - } else if (flags & SPAWN_HAS_PATH) { - path = tmpp; - flags &= ~SPAWN_HAS_PATH; - } else if (flags & SPAWN_HAS_WDIR) { - workingdir = tmpp; - flags &= ~SPAWN_HAS_WDIR; - } - } - - jr = job_new_spawn(label, path, workingdir, argv, env, flags & SPAWN_HAS_UMASK ? &mig_umask : NULL, - flags & SPAWN_WANTS_WAIT4DEBUGGER, flags & SPAWN_WANTS_FORCE_PPC); - - if (jr == NULL) switch (errno) { - case EEXIST: - return BOOTSTRAP_NAME_IN_USE; - default: - return BOOTSTRAP_NO_MEMORY; - } - - job_log(j, LOG_INFO, "Spawned with flags:%s%s", - flags & SPAWN_WANTS_FORCE_PPC ? " ppc": "", - flags & SPAWN_WANTS_WAIT4DEBUGGER ? " stopped": ""); - - *child_pid = job_get_pid(jr); - *obsvr_port = job_get_bsport(jr); - - return BOOTSTRAP_SUCCESS; -} - -bool -trusted_client_check(job_t j, struct ldcred *ldc) -{ - static pid_t last_warned_pid = 0; - - /* In the long run, we wish to enforce the progeny rule, but for now, - * we'll let root and the user be forgiven. Once we get CoreProcesses - * to switch to using launchd rather than the WindowServer for indirect - * process invocation, we can then seriously look at cranking up the - * warning level here. - */ - - if (inherited_asid == ldc->asid) { - return true; - } - if (progeny_check(ldc->pid)) { - return true; - } - if (ldc->euid == geteuid()) { - return true; - } - if (ldc->euid == 0 && ldc->uid == 0) { - return true; - } - if (last_warned_pid == ldc->pid) { - return false; - } - - job_log(j, LOG_NOTICE, "Security: PID %d (ASID %d) was leaked into this session (ASID %d). This will be denied in the future.", ldc->pid, ldc->asid, inherited_asid); - - last_warned_pid = ldc->pid; - - return false; -} -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060924/f4e6dd33/attachment.html From source_changes at macosforge.org Sun Sep 24 14:51:16 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22882] trunk/launchd/src Message-ID: <20060924215116.0FB6B1551B8@cvs.opensource.apple.com> Revision: 22882 http://trac.macosforge.org/projects/launchd/changeset/22882 Author: zarzycki@apple.com Date: 2006-09-24 14:51:15 -0700 (Sun, 24 Sep 2006) Log Message: ----------- Symbol export clean-up. Modified Paths: -------------- trunk/launchd/src/launchd_core_logic.c trunk/launchd/src/launchd_core_logic.h Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:38:16 UTC (rev 22881) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:51:15 UTC (rev 22882) @@ -112,8 +112,16 @@ static void machservice_setup(launch_data_t obj, const char *key, void *context); static void machservice_setup_options(launch_data_t obj, const char *key, void *context); static void machservice_resetport(job_t j, struct machservice *ms); +static struct machservice *machservice_new(job_t j, const char *name, mach_port_t *serviceport); +static void machservice_delete(struct machservice *); +static void machservice_watch(struct machservice *); +static mach_port_t machservice_port(struct machservice *); +static job_t machservice_job(struct machservice *); +static bool machservice_hidden(struct machservice *); +static bool machservice_active(struct machservice *); +static const char *machservice_name(struct machservice *); +static bootstrap_status_t machservice_status(struct machservice *); - struct socketgroup { SLIST_ENTRY(socketgroup) sle; int *fds; @@ -238,6 +246,9 @@ char label[0]; }; +#define job_assumes(j, e) \ + (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) + static job_t job_import2(launch_data_t pload); static void job_import_keys(launch_data_t obj, const char *key, void *context); static void job_import_bool(job_t j, const char *key, bool value); @@ -262,8 +273,27 @@ static void job_setup_env_from_other_jobs(job_t j); static void job_export_all2(job_t j, launch_data_t where); static launch_data_t job_export2(job_t j, bool subjobs); +static job_t job_find_by_pid(job_t j, pid_t p, bool recurse); +static job_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); +static job_t job_new_via_mach_init(job_t jbs, const char *cmd, uid_t uid, bool ond); +static job_t job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port); +static job_t job_new_anonymous(job_t p, pid_t who); +static const char *job_prog(job_t j); +static pid_t job_get_pid(job_t j); +static mach_port_t job_get_bsport(job_t j); +static mach_port_t job_get_reqport(job_t j); +static job_t job_get_bs(job_t j); +static job_t job_parent(job_t j); +static void job_uncork_fork(job_t j); +static struct machservice *job_lookup_service(job_t jbs, const char *name, bool check_parent); +static void job_foreach_service(job_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool only_anonymous); +static void job_log(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +static void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); +static void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); +static kern_return_t job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus); + static const struct { const char *key; int val; Modified: trunk/launchd/src/launchd_core_logic.h =================================================================== --- trunk/launchd/src/launchd_core_logic.h 2006-09-24 21:38:16 UTC (rev 22881) +++ trunk/launchd/src/launchd_core_logic.h 2006-09-24 21:51:15 UTC (rev 22882) @@ -23,66 +23,29 @@ #include "bootstrap_public.h" #include "launch.h" -#define job_assumes(j, e) \ - (__builtin_expect(!(e), 0) ? job_log_bug(j, __rcs_file_version__, __FILE__, __LINE__, #e), false : true) - - typedef struct job_s *job_t; -struct machservice; +extern job_t root_job; +extern job_t gc_this_job; +extern size_t total_children; -struct machservice *machservice_new(job_t j, const char *name, mach_port_t *serviceport); -void machservice_delete(struct machservice *); -void machservice_watch(struct machservice *); -mach_port_t machservice_port(struct machservice *); -job_t machservice_job(struct machservice *); -bool machservice_hidden(struct machservice *); -bool machservice_active(struct machservice *); -const char *machservice_name(struct machservice *); -bootstrap_status_t machservice_status(struct machservice *); - - -job_t job_find(job_t j, const char *label); -job_t job_find_by_pid(job_t j, pid_t p, bool recurse); -job_t job_mig_intran(mach_port_t mp); -void job_mig_destructor(job_t j); -job_t job_import(launch_data_t pload); -launch_data_t job_import_bulk(launch_data_t pload); job_t job_new(job_t p, const char *label, const char *prog, const char *const *argv, const char *stdinpath, mach_port_t); -job_t job_new_spawn(const char *label, const char *path, const char *workingdir, const char *const *argv, const char *const *env, mode_t *u_mask, bool w4d, bool fppc); -job_t job_new_via_mach_init(job_t jbs, const char *cmd, uid_t uid, bool ond); -job_t job_new_bootstrap(job_t p, mach_port_t requestorport, mach_port_t checkin_port); -job_t job_new_anonymous(job_t p, pid_t who); -launch_data_t job_export(job_t j); -launch_data_t job_export_all(void); void job_dispatch(job_t j, bool kickstart); +bool job_active(job_t j); +void job_remove_all_inactive(job_t j); void job_dispatch_all_other_semaphores(job_t j, job_t nj); +launch_data_t job_export(job_t j); +launch_data_t job_export_all(void); void job_stop(job_t j); -bool job_active(job_t j); void job_checkin(job_t j); -const char *job_prog(job_t j); void job_remove(job_t j); -void job_remove_all_inactive(job_t j); +job_t job_find(job_t j, const char *label); +job_t job_import(launch_data_t pload); +launch_data_t job_import_bulk(launch_data_t pload); +job_t job_mig_intran(mach_port_t mp); +void job_mig_destructor(job_t j); bool job_ack_port_destruction(job_t j, mach_port_t p); void job_ack_no_senders(job_t j); -pid_t job_get_pid(job_t j); -mach_port_t job_get_bsport(job_t j); -mach_port_t job_get_reqport(job_t j); -job_t job_get_bs(job_t j); void job_delete_anything_with_port(job_t jbs, mach_port_t port); -job_t job_parent(job_t j); -void job_uncork_fork(job_t j); -struct machservice *job_lookup_service(job_t jbs, const char *name, bool check_parent); -void job_foreach_service(job_t jbs, void (*bs_iter)(struct machservice *, void *), void *context, bool only_anonymous); -void job_log(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_error(job_t j, int pri, const char *msg, ...) __attribute__((format(printf, 3, 4))); -void job_log_bug(job_t j, const char *rcs_rev, const char *path, unsigned int line, const char *test); -kern_return_t job_handle_mpm_wait(job_t j, mach_port_t srp, int *waitstatus); -extern size_t total_children; - -extern job_t root_job; - -extern job_t gc_this_job; - #endif -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060924/66c9fda6/attachment.html From source_changes at macosforge.org Mon Sep 25 10:47:17 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22883] trunk/launchd/src Message-ID: <20060925174717.B5E9D15A8E7@cvs.opensource.apple.com> Revision: 22883 http://trac.macosforge.org/projects/launchd/changeset/22883 Author: zarzycki@apple.com Date: 2006-09-25 10:47:17 -0700 (Mon, 25 Sep 2006) Log Message: ----------- Rename all MIG defs files to protocol_* if they are meant for IPC to/from launchd. Group all supplemental MIG type goo in one file. We're leaving the internal thread-to-thread IPC glue as launchd_internal.defs for now. Modified Paths: -------------- trunk/launchd/src/Makefile.am trunk/launchd/src/Makefile.in trunk/launchd/src/launchd_core_logic.c Added Paths: ----------- trunk/launchd/src/launchd_mig_types.defs trunk/launchd/src/protocol_job.defs trunk/launchd/src/protocol_job_reply.defs trunk/launchd/src/protocol_jobmgr.defs trunk/launchd/src/protocol_legacy.defs Removed Paths: ------------- trunk/launchd/src/bootstrap.defs trunk/launchd/src/mpm_reply.defs Modified: trunk/launchd/src/Makefile.am =================================================================== --- trunk/launchd/src/Makefile.am 2006-09-24 21:51:15 UTC (rev 22882) +++ trunk/launchd/src/Makefile.am 2006-09-25 17:47:17 UTC (rev 22883) @@ -2,10 +2,10 @@ CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ - notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h + notifyServer.c notifyServer.h job_replyUser.c job_reply.h -bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/bootstrap.defs - mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/bootstrap.defs +bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/protocol_legacy.defs + mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/protocol_legacy.defs if LIBS_ONLY @@ -43,19 +43,18 @@ launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden launchd_LDFLAGS = -lbsm -launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c +launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c launchd_runtime.c:: notifyServer.h launchd_internal.h -launchd_core_logic.c:: bootstrap.h mpm_reply.h bootstrap.h bootstrapServer.h -#launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h +launchd_core_logic.c:: bootstrap.h job_reply.h bootstrap.h bootstrapServer.h launchproxy_LDFLAGS = -weak_framework Security notifyServer.c notifyServer.h: /usr/include/mach/notify.defs mig $(MIGFLAGS) -header /dev/null -user /dev/null -sheader notifyServer.h /usr/include/mach/notify.defs -mpm_replyUser.c mpm_reply.h: $(srcdir)/mpm_reply.defs - mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/mpm_reply.defs +job_replyUser.c job_reply.h: $(srcdir)/protocol_job_reply.defs + mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/protocol_job_reply.defs launchd_internal.h launchd_internalServer.c launchd_internalUser.c launchd_internalServer.h: $(srcdir)/launchd_internal.defs mig $(MIGFLAGS) -sheader launchd_internalServer.h $(srcdir)/launchd_internal.defs Modified: trunk/launchd/src/Makefile.in =================================================================== --- trunk/launchd/src/Makefile.in 2006-09-24 21:51:15 UTC (rev 22882) +++ trunk/launchd/src/Makefile.in 2006-09-25 17:47:17 UTC (rev 22883) @@ -88,7 +88,7 @@ am__launchd_SOURCES_DIST = launchd.c launchd_core_logic.c \ launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c \ launchd_internalUser.c launchd_internalServer.c \ - mpm_replyUser.c launchd_runtime.c + job_replyUser.c launchd_runtime.c @LIBS_ONLY_FALSE@am_launchd_OBJECTS = launchd-launchd.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_core_logic.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_unix_ipc.$(OBJEXT) \ @@ -97,7 +97,7 @@ @LIBS_ONLY_FALSE@ launchd-notifyServer.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_internalUser.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_internalServer.$(OBJEXT) \ -@LIBS_ONLY_FALSE@ launchd-mpm_replyUser.$(OBJEXT) \ +@LIBS_ONLY_FALSE@ launchd-job_replyUser.$(OBJEXT) \ @LIBS_ONLY_FALSE@ launchd-launchd_runtime.$(OBJEXT) launchd_OBJECTS = $(am_launchd_OBJECTS) launchd_LDADD = $(LDADD) @@ -224,7 +224,7 @@ AM_CFLAGS = -no-cpp-precomp -F/System/Library/PrivateFrameworks -Wall -Wextra -Waggregate-return -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror -D__MigTypeCheck=1 CLEANFILES = bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h \ launchd_internal.h launchd_internalServer.h launchd_internalServer.h launchd_internalUser.c \ - notifyServer.c notifyServer.h mpm_replyUser.c mpm_reply.h + notifyServer.c notifyServer.h job_replyUser.c job_reply.h @LIBS_ONLY_TRUE@noinst_LIBRARIES = liblaunch.a liblaunch_profile.a @LIBS_ONLY_TRUE@liblaunch_a_SOURCES = liblaunch.c bootstrap_public.c @@ -239,8 +239,7 @@ @LIBS_ONLY_FALSE@SystemStarter_SOURCES = StartupItems.c IPC.c SystemStarter.c @LIBS_ONLY_FALSE@launchd_CFLAGS = -mdynamic-no-pic $(AM_CFLAGS) -Wno-unused-parameter -fvisibility=hidden @LIBS_ONLY_FALSE@launchd_LDFLAGS = -lbsm -@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c mpm_replyUser.c launchd_runtime.c -#launchd.c:: bootstrap.h launchd_internalServer.h launchd_internal.h notifyServer.h bootstrapServer.h +@LIBS_ONLY_FALSE@launchd_SOURCES = launchd.c launchd_core_logic.c launchd_unix_ipc.c init.c bootstrapServer.c notifyServer.c launchd_internalUser.c launchd_internalServer.c job_replyUser.c launchd_runtime.c @LIBS_ONLY_FALSE@launchproxy_LDFLAGS = -weak_framework Security @LIBS_ONLY_FALSE@man1_MANS = wait4path.1 launchctl.1 @LIBS_ONLY_FALSE@man5_MANS = launchd.plist.5 launchd.conf.5 @@ -425,13 +424,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchctl-launchctl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-bootstrapServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-job_replyUser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_core_logic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_internalUser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_runtime.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-launchd_unix_ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-mpm_replyUser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd-notifyServer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchproxy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblaunch.Po@am__quote@ @@ -649,19 +648,19 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-launchd_internalServer.obj `if test -f 'launchd_internalServer.c'; then $(CYGPATH_W) 'launchd_internalServer.c'; else $(CYGPATH_W) '$(srcdir)/launchd_internalServer.c'; fi` -launchd-mpm_replyUser.o: mpm_replyUser.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-mpm_replyUser.o -MD -MP -MF "$(DEPDIR)/launchd-mpm_replyUser.Tpo" -c -o launchd-mpm_replyUser.o `test -f 'mpm_replyUser.c' || echo '$(srcdir)/'`mpm_replyUser.c; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo" "$(DEPDIR)/launchd-mpm_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.o' libtool=no @AMDEPBACKSLASH@ +launchd-job_replyUser.o: job_replyUser.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-job_replyUser.o -MD -MP -MF "$(DEPDIR)/launchd-job_replyUser.Tpo" -c -o launchd-job_replyUser.o `test -f 'job_replyUser.c' || echo '$(srcdir)/'`job_replyUser.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-job_replyUser.Tpo" "$(DEPDIR)/launchd-job_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-job_replyUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='job_replyUser.c' object='launchd-job_replyUser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.o `test -f 'mpm_replyUser.c' || echo '$(srcdir)/'`mpm_replyUser.c +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-job_replyUser.o `test -f 'job_replyUser.c' || echo '$(srcdir)/'`job_replyUser.c -launchd-mpm_replyUser.obj: mpm_replyUser.c -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-mpm_replyUser.obj -MD -MP -MF "$(DEPDIR)/launchd-mpm_replyUser.Tpo" -c -o launchd-mpm_replyUser.obj `if test -f 'mpm_replyUser.c'; then $(CYGPATH_W) 'mpm_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/mpm_replyUser.c'; fi`; \ -@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo" "$(DEPDIR)/launchd-mpm_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-mpm_replyUser.Tpo"; exit 1; fi -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mpm_replyUser.c' object='launchd-mpm_replyUser.obj' libtool=no @AMDEPBACKSLASH@ +launchd-job_replyUser.obj: job_replyUser.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-job_replyUser.obj -MD -MP -MF "$(DEPDIR)/launchd-job_replyUser.Tpo" -c -o launchd-job_replyUser.obj `if test -f 'job_replyUser.c'; then $(CYGPATH_W) 'job_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/job_replyUser.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/launchd-job_replyUser.Tpo" "$(DEPDIR)/launchd-job_replyUser.Po"; else rm -f "$(DEPDIR)/launchd-job_replyUser.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='job_replyUser.c' object='launchd-job_replyUser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-mpm_replyUser.obj `if test -f 'mpm_replyUser.c'; then $(CYGPATH_W) 'mpm_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/mpm_replyUser.c'; fi` +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -c -o launchd-job_replyUser.obj `if test -f 'job_replyUser.c'; then $(CYGPATH_W) 'job_replyUser.c'; else $(CYGPATH_W) '$(srcdir)/job_replyUser.c'; fi` launchd-launchd_runtime.o: launchd_runtime.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(launchd_CFLAGS) $(CFLAGS) -MT launchd-launchd_runtime.o -MD -MP -MF "$(DEPDIR)/launchd-launchd_runtime.Tpo" -c -o launchd-launchd_runtime.o `test -f 'launchd_runtime.c' || echo '$(srcdir)/'`launchd_runtime.c; \ @@ -1014,8 +1013,8 @@ uninstall-sbinSCRIPTS uninstall-sysconfDATA -bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/bootstrap.defs - mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/bootstrap.defs +bootstrap.h bootstrapServer.c bootstrapUser.c bootstrapServer.h: $(srcdir)/protocol_legacy.defs + mig $(MIGFLAGS) -sheader bootstrapServer.h $(srcdir)/protocol_legacy.defs @LIBS_ONLY_TRUE@$(srcdir)/bootstrap_public.c:: bootstrap.h @@ -1026,13 +1025,13 @@ @LIBS_ONLY_TRUE@ cp liblaunch_profile.a $(DESTDIR)/usr/local/lib/system/liblaunch_profile.a @LIBS_ONLY_FALSE@launchd_runtime.c:: notifyServer.h launchd_internal.h -@LIBS_ONLY_FALSE@launchd_core_logic.c:: bootstrap.h mpm_reply.h bootstrap.h bootstrapServer.h +@LIBS_ONLY_FALSE@launchd_core_logic.c:: bootstrap.h job_reply.h bootstrap.h bootstrapServer.h @LIBS_ONLY_FALSE@notifyServer.c notifyServer.h: /usr/include/mach/notify.defs @LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -header /dev/null -user /dev/null -sheader notifyServer.h /usr/include/mach/notify.defs -@LIBS_ONLY_FALSE@mpm_replyUser.c mpm_reply.h: $(srcdir)/mpm_reply.defs -@LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/mpm_reply.defs +@LIBS_ONLY_FALSE@job_replyUser.c job_reply.h: $(srcdir)/protocol_job_reply.defs +@LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -sheader /dev/null -server /dev/null $(srcdir)/protocol_job_reply.defs @LIBS_ONLY_FALSE@launchd_internal.h launchd_internalServer.c launchd_internalUser.c launchd_internalServer.h: $(srcdir)/launchd_internal.defs @LIBS_ONLY_FALSE@ mig $(MIGFLAGS) -sheader launchd_internalServer.h $(srcdir)/launchd_internal.defs Deleted: trunk/launchd/src/bootstrap.defs =================================================================== --- trunk/launchd/src/bootstrap.defs 2006-09-24 21:51:15 UTC (rev 22882) +++ trunk/launchd/src/bootstrap.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -1,140 +0,0 @@ -/* - * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ -/* - * bootstrap -- fundamental service initiator and port server - * Mike DeMoney, NeXT, Inc. - * Copyright, 1990. All rights reserved. - */ - -subsystem bootstrap 400; - -#include -#include -import "bootstrap_public.h"; -import "bootstrap_private.h"; - -type pid_t = integer_t; -type cmd_t = c_string[512]; -type cmd_array_t = ^array [] of cmd_t; -type name_t = c_string[128]; -type name_array_t = ^array [] of name_t; -type _internal_string_t = ^array [] of char; -type bootstrap_status_t = integer_t; -type bootstrap_status_array_t = ^array [] of bootstrap_status_t; - -type job_t = mach_port_t - intran: job_t job_mig_intran(mach_port_t) - outtran: mach_port_t job_mig_outtran(job_t) - destructor: job_mig_destructor(job_t) - cusertype: vproc_mig_t; - - -userprefix vproc_mig_; -serverprefix job_mig_; - -routine create_server( - __bs_port : job_t; - __server_cmd : cmd_t; - __server_uid : natural_t; - __on_demand : boolean_t; - ServerAuditToken __token : audit_token_t; - out __server_port : mach_port_make_send_t); - -skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ - -routine check_in( - __bs_port : job_t; - __service_name : name_t; - ServerAuditToken __token : audit_token_t; - out __service_port : mach_port_move_receive_t); - -routine register( - __bs_port : job_t; - ServerAuditToken __token : audit_token_t; - __service_name : name_t; - __service_port : mach_port_t); - -routine look_up( - __bs_port : job_t; - ServerAuditToken __token : audit_token_t; - __service_name : name_t; - out __service_port : mach_port_send_t); - -skip; /* last used in 10.4 */ - -routine parent( - __bs_port : job_t; - out __parent_port : mach_port_send_t); - -skip; /* last used in 10.4 */ - -routine info( - __bs_port : job_t; - out __service_names : name_array_t, dealloc; - out __service_active : bootstrap_status_array_t, dealloc); - -routine subset( - __bs_port : job_t; - __requestor_port: mach_port_t; - out __subset_port : mach_port_make_send_t); - -routine create_service( - __bs_port : job_t; - __service_name : name_t; - out __service_port : mach_port_t); - -routine transfer_subset( - __bs_port : job_t; - out __bs_reqport : mach_port_t; - out __bs_rcvright : mach_port_move_receive_t; - out __service_names : name_array_t, dealloc; - out __service_pids : pointer_t, dealloc; - out __service_ports : mach_port_array_t, dealloc); - -routine getsocket( - __bs_port : job_t; - out __sockpath : name_t); - -routine spawn( - __bs_port : job_t; - ServerAuditToken __token : audit_token_t; - __chars : _internal_string_t; - __argc : uint32_t; - __envc : uint32_t; - __flags : uint64_t; - __umask : uint16_t; - out __pid : pid_t; - out __obsvr_port : mach_port_make_send_t); - -routine wait( - __bs_port : job_t; - sreplyport __rport : mach_port_make_send_once_t; - ServerAuditToken __token : audit_token_t; - out __waitval : integer_t); - -routine uncork_fork( - __bs_port : job_t; - ServerAuditToken __token : audit_token_t); - -/* Essentially the inverse of bootstrap_unprivileged() */ -routine get_self( - __bs_port : job_t; - ServerAuditToken __token : audit_token_t; - out __job_port : mach_port_make_send_t); Modified: trunk/launchd/src/launchd_core_logic.c =================================================================== --- trunk/launchd/src/launchd_core_logic.c 2006-09-24 21:51:15 UTC (rev 22882) +++ trunk/launchd/src/launchd_core_logic.c 2006-09-25 17:47:17 UTC (rev 22883) @@ -80,7 +80,7 @@ #include "bootstrap_private.h" #include "bootstrap.h" #include "bootstrapServer.h" -#include "mpm_reply.h" +#include "job_reply.h" #define LAUNCHD_MIN_JOB_RUN_TIME 10 #define LAUNCHD_ADVISABLE_IDLE_TIMEOUT 30 @@ -1474,7 +1474,7 @@ if (j->wait_reply_port) { job_log(j, LOG_DEBUG, "MPM wait reply being sent"); - job_assumes(j, mpm_wait_reply(j->wait_reply_port, 0, status) == 0); + job_assumes(j, job_mig_wait_reply(j->wait_reply_port, 0, status) == 0); j->wait_reply_port = MACH_PORT_NULL; } Copied: trunk/launchd/src/launchd_mig_types.defs (from rev 22882, trunk/launchd/src/bootstrap.defs) =================================================================== --- trunk/launchd/src/launchd_mig_types.defs (rev 0) +++ trunk/launchd/src/launchd_mig_types.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999-2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ +/* + * bootstrap -- fundamental service initiator and port server + * Mike DeMoney, NeXT, Inc. + * Copyright, 1990. All rights reserved. + */ + +type pid_t = integer_t; +type cmd_t = c_string[512]; +type cmd_array_t = ^array [] of cmd_t; +type name_t = c_string[128]; +type name_array_t = ^array [] of name_t; +type _internal_string_t = ^array [] of char; +type bootstrap_status_t = integer_t; +type bootstrap_status_array_t = ^array [] of bootstrap_status_t; + +type job_t = mach_port_t + intran: job_t job_mig_intran(mach_port_t) + outtran: mach_port_t job_mig_outtran(job_t) + destructor: job_mig_destructor(job_t) + cusertype: vproc_mig_t; Deleted: trunk/launchd/src/mpm_reply.defs =================================================================== --- trunk/launchd/src/mpm_reply.defs 2006-09-24 21:51:15 UTC (rev 22882) +++ trunk/launchd/src/mpm_reply.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. - * - * @APPLE_APACHE_LICENSE_HEADER_START@ - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * @APPLE_APACHE_LICENSE_HEADER_END@ - */ - -subsystem mpm_reply 500; - -#include -#include -import "bootstrap_public.h"; -import "bootstrap_private.h"; - -type pid_t = integer_t; - -skip; /* create_server */ - -skip; /* unprivileged */ - -skip; /* check_in */ - -skip; /* register */ - -skip; /* look_up */ - -skip; - -skip; /* parent */ - -skip; - -skip; /* info */ - -skip; /* subset */ - -skip; /* create_service */ - -skip; /* transfer_subset */ - -skip; /* getsocket */ - -skip; /* spawn */ - -simpleroutine mpm_wait_reply( - __r_port : mach_port_move_send_once_t; - __result : kern_return_t, RetCode; - __wait : integer_t); Copied: trunk/launchd/src/protocol_job.defs (from rev 22882, trunk/launchd/src/bootstrap.defs) =================================================================== --- trunk/launchd/src/protocol_job.defs (rev 0) +++ trunk/launchd/src/protocol_job.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ +/* + * bootstrap -- fundamental service initiator and port server + * Mike DeMoney, NeXT, Inc. + * Copyright, 1990. All rights reserved. + */ + +subsystem bootstrap 400; + +#include +#include +#include "launchd_mig_types.defs" +import "bootstrap_public.h"; +import "bootstrap_private.h"; + +userprefix vproc_mig_; +serverprefix job_mig_; + +routine create_server( + __bs_port : job_t; + __server_cmd : cmd_t; + __server_uid : natural_t; + __on_demand : boolean_t; + ServerAuditToken __token : audit_token_t; + out __server_port : mach_port_make_send_t); + +skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ + +routine check_in( + __bs_port : job_t; + __service_name : name_t; + ServerAuditToken __token : audit_token_t; + out __service_port : mach_port_move_receive_t); + +routine register( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + __service_port : mach_port_t); + +routine look_up( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + out __service_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine parent( + __bs_port : job_t; + out __parent_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine info( + __bs_port : job_t; + out __service_names : name_array_t, dealloc; + out __service_active : bootstrap_status_array_t, dealloc); + +routine subset( + __bs_port : job_t; + __requestor_port: mach_port_t; + out __subset_port : mach_port_make_send_t); + +routine create_service( + __bs_port : job_t; + __service_name : name_t; + out __service_port : mach_port_t); + +routine transfer_subset( + __bs_port : job_t; + out __bs_reqport : mach_port_t; + out __bs_rcvright : mach_port_move_receive_t; + out __service_names : name_array_t, dealloc; + out __service_pids : pointer_t, dealloc; + out __service_ports : mach_port_array_t, dealloc); + +routine getsocket( + __bs_port : job_t; + out __sockpath : name_t); + +routine spawn( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __chars : _internal_string_t; + __argc : uint32_t; + __envc : uint32_t; + __flags : uint64_t; + __umask : uint16_t; + out __pid : pid_t; + out __obsvr_port : mach_port_make_send_t); + +routine wait( + __bs_port : job_t; + sreplyport __rport : mach_port_make_send_once_t; + ServerAuditToken __token : audit_token_t; + out __waitval : integer_t); + +routine uncork_fork( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t); + +/* Essentially the inverse of bootstrap_unprivileged() */ +routine get_self( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + out __job_port : mach_port_make_send_t); Copied: trunk/launchd/src/protocol_job_reply.defs (from rev 22882, trunk/launchd/src/mpm_reply.defs) =================================================================== --- trunk/launchd/src/protocol_job_reply.defs (rev 0) +++ trunk/launchd/src/protocol_job_reply.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +subsystem job_reply 500; + +#include +#include +#include "launchd_mig_types.defs" +import "bootstrap_public.h"; +import "bootstrap_private.h"; + +skip; /* create_server */ + +skip; /* unprivileged */ + +skip; /* check_in */ + +skip; /* register */ + +skip; /* look_up */ + +skip; + +skip; /* parent */ + +skip; + +skip; /* info */ + +skip; /* subset */ + +skip; /* create_service */ + +skip; /* transfer_subset */ + +skip; /* getsocket */ + +skip; /* spawn */ + +simpleroutine job_mig_wait_reply( + __r_port : mach_port_move_send_once_t; + __result : kern_return_t, RetCode; + __wait : integer_t); Copied: trunk/launchd/src/protocol_jobmgr.defs (from rev 22882, trunk/launchd/src/bootstrap.defs) =================================================================== --- trunk/launchd/src/protocol_jobmgr.defs (rev 0) +++ trunk/launchd/src/protocol_jobmgr.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ +/* + * bootstrap -- fundamental service initiator and port server + * Mike DeMoney, NeXT, Inc. + * Copyright, 1990. All rights reserved. + */ + +subsystem bootstrap 400; + +#include +#include +#include "launchd_mig_types.defs" +import "bootstrap_public.h"; +import "bootstrap_private.h"; + +userprefix vproc_mig_; +serverprefix job_mig_; + +routine create_server( + __bs_port : job_t; + __server_cmd : cmd_t; + __server_uid : natural_t; + __on_demand : boolean_t; + ServerAuditToken __token : audit_token_t; + out __server_port : mach_port_make_send_t); + +skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ + +routine check_in( + __bs_port : job_t; + __service_name : name_t; + ServerAuditToken __token : audit_token_t; + out __service_port : mach_port_move_receive_t); + +routine register( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + __service_port : mach_port_t); + +routine look_up( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + out __service_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine parent( + __bs_port : job_t; + out __parent_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine info( + __bs_port : job_t; + out __service_names : name_array_t, dealloc; + out __service_active : bootstrap_status_array_t, dealloc); + +routine subset( + __bs_port : job_t; + __requestor_port: mach_port_t; + out __subset_port : mach_port_make_send_t); + +routine create_service( + __bs_port : job_t; + __service_name : name_t; + out __service_port : mach_port_t); + +routine transfer_subset( + __bs_port : job_t; + out __bs_reqport : mach_port_t; + out __bs_rcvright : mach_port_move_receive_t; + out __service_names : name_array_t, dealloc; + out __service_pids : pointer_t, dealloc; + out __service_ports : mach_port_array_t, dealloc); + +routine getsocket( + __bs_port : job_t; + out __sockpath : name_t); + +routine spawn( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __chars : _internal_string_t; + __argc : uint32_t; + __envc : uint32_t; + __flags : uint64_t; + __umask : uint16_t; + out __pid : pid_t; + out __obsvr_port : mach_port_make_send_t); + +routine wait( + __bs_port : job_t; + sreplyport __rport : mach_port_make_send_once_t; + ServerAuditToken __token : audit_token_t; + out __waitval : integer_t); + +routine uncork_fork( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t); + +/* Essentially the inverse of bootstrap_unprivileged() */ +routine get_self( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + out __job_port : mach_port_make_send_t); Copied: trunk/launchd/src/protocol_legacy.defs (from rev 22882, trunk/launchd/src/bootstrap.defs) =================================================================== --- trunk/launchd/src/protocol_legacy.defs (rev 0) +++ trunk/launchd/src/protocol_legacy.defs 2006-09-25 17:47:17 UTC (rev 22883) @@ -0,0 +1,125 @@ +/* + * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ +/* + * bootstrap -- fundamental service initiator and port server + * Mike DeMoney, NeXT, Inc. + * Copyright, 1990. All rights reserved. + */ + +subsystem bootstrap 400; + +#include +#include +#include "launchd_mig_types.defs" +import "bootstrap_public.h"; +import "bootstrap_private.h"; + +userprefix vproc_mig_; +serverprefix job_mig_; + +routine create_server( + __bs_port : job_t; + __server_cmd : cmd_t; + __server_uid : natural_t; + __on_demand : boolean_t; + ServerAuditToken __token : audit_token_t; + out __server_port : mach_port_make_send_t); + +skip; /* Last used in 10.4. Was bootstrap_unprivileged() */ + +routine check_in( + __bs_port : job_t; + __service_name : name_t; + ServerAuditToken __token : audit_token_t; + out __service_port : mach_port_move_receive_t); + +routine register( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + __service_port : mach_port_t); + +routine look_up( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __service_name : name_t; + out __service_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine parent( + __bs_port : job_t; + out __parent_port : mach_port_send_t); + +skip; /* last used in 10.4 */ + +routine info( + __bs_port : job_t; + out __service_names : name_array_t, dealloc; + out __service_active : bootstrap_status_array_t, dealloc); + +routine subset( + __bs_port : job_t; + __requestor_port: mach_port_t; + out __subset_port : mach_port_make_send_t); + +routine create_service( + __bs_port : job_t; + __service_name : name_t; + out __service_port : mach_port_t); + +routine transfer_subset( + __bs_port : job_t; + out __bs_reqport : mach_port_t; + out __bs_rcvright : mach_port_move_receive_t; + out __service_names : name_array_t, dealloc; + out __service_pids : pointer_t, dealloc; + out __service_ports : mach_port_array_t, dealloc); + +routine getsocket( + __bs_port : job_t; + out __sockpath : name_t); + +routine spawn( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + __chars : _internal_string_t; + __argc : uint32_t; + __envc : uint32_t; + __flags : uint64_t; + __umask : uint16_t; + out __pid : pid_t; + out __obsvr_port : mach_port_make_send_t); + +routine wait( + __bs_port : job_t; + sreplyport __rport : mach_port_make_send_once_t; + ServerAuditToken __token : audit_token_t; + out __waitval : integer_t); + +routine uncork_fork( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t); + +/* Essentially the inverse of bootstrap_unprivileged() */ +routine get_self( + __bs_port : job_t; + ServerAuditToken __token : audit_token_t; + out __job_port : mach_port_make_send_t); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060925/ef201e4a/attachment.html From source_changes at macosforge.org Tue Sep 26 07:46:57 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:32 2007 Subject: [launchd-changes] [22884] trunk/launchd/doc/HOWTO.html Message-ID: <20060926144657.3455B1607FD@cvs.opensource.apple.com> Revision: 22884 http://trac.macosforge.org/projects/launchd/changeset/22884 Author: zarzycki@apple.com Date: 2006-09-26 07:46:57 -0700 (Tue, 26 Sep 2006) Log Message: ----------- Set the right MIME type on HTML files. Property Changed: ---------------- trunk/launchd/doc/HOWTO.html Property changes on: trunk/launchd/doc/HOWTO.html ___________________________________________________________________ Name: svn:mime-type + text/html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060926/78124d64/attachment.html From source_changes at macosforge.org Wed Sep 27 08:14:54 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:33 2007 Subject: [launchd-changes] [22885] trunk/launchd/src/launch.h Message-ID: <20060927151454.AFECE175883@cvs.opensource.apple.com> Revision: 22885 http://trac.macosforge.org/projects/launchd/changeset/22885 Author: zarzycki@apple.com Date: 2006-09-27 08:14:53 -0700 (Wed, 27 Sep 2006) Log Message: ----------- Typo. Modified Paths: -------------- trunk/launchd/src/launch.h Modified: trunk/launchd/src/launch.h =================================================================== --- trunk/launchd/src/launch.h 2006-09-26 14:46:57 UTC (rev 22884) +++ trunk/launchd/src/launch.h 2006-09-27 15:14:53 UTC (rev 22885) @@ -92,7 +92,7 @@ #define LAUNCH_JOBKEY_LASTEXITSTATUS "LastExitStatus" #define LAUNCH_JOBKEY_PID "PID" #define LAUNCH_JOBKEY_SUBJOBS "SubJobs" -#define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInternval" +#define LAUNCH_JOBKEY_THROTTLEINTERVAL "ThrottleInterval" #define LAUNCH_JOBINETDCOMPATIBILITY_WAIT "Wait" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060927/774fa5d5/attachment.html From source_changes at macosforge.org Wed Sep 27 10:56:01 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:33 2007 Subject: [launchd-changes] [22886] trunk/launchd/src/launchctl.c Message-ID: <20060927175601.AD1EB177025@cvs.opensource.apple.com> Revision: 22886 http://trac.macosforge.org/projects/launchd/changeset/22886 Author: zarzycki@apple.com Date: 2006-09-27 10:56:00 -0700 (Wed, 27 Sep 2006) Log Message: ----------- >From the manager of the Installer team in an e-mail today: I would prefer /etc/rc.cdrom to /System/Installation since /System/Installation is part of the Install project and whenever we install roots on our system we will end up with a system that has /System/Installation. I would hate to have that trigger everything behaving differently. Modified Paths: -------------- trunk/launchd/src/launchctl.c Modified: trunk/launchd/src/launchctl.c =================================================================== --- trunk/launchd/src/launchctl.c 2006-09-27 15:14:53 UTC (rev 22885) +++ trunk/launchd/src/launchctl.c 2006-09-27 17:56:00 UTC (rev 22886) @@ -1182,7 +1182,7 @@ apply_sysctls_from_file("/etc/sysctl-macosxserver.conf"); apply_sysctls_from_file("/etc/sysctl.conf"); - if (path_check("/System/Installation") && path_check("/etc/rc.cdrom")) { + if (path_check("/etc/rc.cdrom")) { const char *rccdrom_tool[] = { _PATH_BSHELL, "/etc/rc.cdrom", "multiuser", NULL }; assumes(fwexec(rccdrom_tool, true) != -1); assumes(reboot(RB_HALT) != -1); -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060927/0eea0e79/attachment.html From source_changes at macosforge.org Thu Sep 28 12:28:39 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:33 2007 Subject: [launchd-changes] [22887] tags/launchd-163.1/ Message-ID: <20060928192839.60F44181613@cvs.opensource.apple.com> Revision: 22887 http://trac.macosforge.org/projects/launchd/changeset/22887 Author: zarzycki@apple.com Date: 2006-09-28 12:28:38 -0700 (Thu, 28 Sep 2006) Log Message: ----------- A hack branch to get the vproc API submitted without the rest of the changes in the mainline source. Added Paths: ----------- tags/launchd-163.1/ Copied: tags/launchd-163.1 (from rev 22886, tags/launchd-163) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060928/d72d1bec/attachment.html From source_changes at macosforge.org Thu Sep 28 12:38:17 2006 From: source_changes at macosforge.org (source_changes@macosforge.org) Date: Tue Oct 9 16:25:33 2007 Subject: [launchd-changes] [22888] tags/launchd-163.1/launchd/src Message-ID: <20060928193817.DE582181706@cvs.opensource.apple.com> Revision: 22888 http://trac.macosforge.org/projects/launchd/changeset/22888 Author: zarzycki@apple.com Date: 2006-09-28 12:38:17 -0700 (Thu, 28 Sep 2006) Log Message: ----------- Add the vproc header file to the build. Modified Paths: -------------- tags/launchd-163.1/launchd/src/Makefile.am tags/launchd-163.1/launchd/src/Makefile.in Added Paths: ----------- tags/launchd-163.1/launchd/src/vproc.h Modified: tags/launchd-163.1/launchd/src/Makefile.am =================================================================== --- tags/launchd-163.1/launchd/src/Makefile.am 2006-09-28 19:28:38 UTC (rev 22887) +++ tags/launchd-163.1/launchd/src/Makefile.am 2006-09-28 19:38:17 UTC (rev 22888) @@ -81,6 +81,7 @@ cp $(srcdir)/StartupItemContext $(DESTDIR)/usr/libexec mkdir -p $(DESTDIR)/usr/include/servers cp $(srcdir)/launch.h $(DESTDIR)/usr/include + cp $(srcdir)/vproc.h $(DESTDIR)/usr/include cp $(srcdir)/bootstrap_public.h $(DESTDIR)/usr/include/servers/bootstrap.h cp $(srcdir)/bootstrap_public.h $(DESTDIR)/usr/include/servers/bootstrap_defs.h mkdir -p $(DESTDIR)/usr/local/include Modified: tags/launchd-163.1/launchd/src/Makefile.in =================================================================== --- tags/launchd-163.1/launchd/src/Makefile.in 2006-09-28 19:28:38 UTC (rev 22887) +++ tags/launchd-163.1/launchd/src/Makefile.in 2006-09-28 19:38:17 UTC (rev 22888) @@ -1064,6 +1064,7 @@ @LIBS_ONLY_FALSE@ cp $(srcdir)/StartupItemContext $(DESTDIR)/usr/libexec @LIBS_ONLY_FALSE@ mkdir -p $(DESTDIR)/usr/include/servers @LIBS_ONLY_FALSE@ cp $(srcdir)/launch.h $(DESTDIR)/usr/include +@LIBS_ONLY_FALSE@ cp $(srcdir)/vproc.h $(DESTDIR)/usr/include @LIBS_ONLY_FALSE@ cp $(srcdir)/bootstrap_public.h $(DESTDIR)/usr/include/servers/bootstrap.h @LIBS_ONLY_FALSE@ cp $(srcdir)/bootstrap_public.h $(DESTDIR)/usr/include/servers/bootstrap_defs.h @LIBS_ONLY_FALSE@ mkdir -p $(DESTDIR)/usr/local/include Added: tags/launchd-163.1/launchd/src/vproc.h =================================================================== --- tags/launchd-163.1/launchd/src/vproc.h (rev 0) +++ tags/launchd-163.1/launchd/src/vproc.h 2006-09-28 19:38:17 UTC (rev 22888) @@ -0,0 +1,78 @@ +#ifndef _VPROC_H_ +#define _VPROC_H_ +/* + * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. + * + * @APPLE_APACHE_LICENSE_HEADER_START@ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @APPLE_APACHE_LICENSE_HEADER_END@ + */ + +__BEGIN_DECLS + +typedef void * vproc_t; +typedef void * vprocmgr_t; +typedef void * vproc_err_t; + +/* By default, pass NULL for vprocmgr_t or vproc_t to get notions of self or "my manager" */ + +vproc_err_t vprocmgr_create_vproc(vprocmgr_t vpm, launch_data_t the_vproc, vproc_t *vp); + +/* If creating multiple jobs, it is wise to create them atomically with respect to each other */ +vproc_err_t vprocmgr_create_vprocs(vprocmgr_t vpm, launch_data_t *the_vprocs, vproc_t *vp, size_t cnt); + +vproc_err_t vprocmgr_delete_vproc(vprocmgr_t vpm, vproc_t vp); + +/* The virtual process managers are arranged in a hierarchy */ +vproc_err_t vprocmgr_get_parent(vprocmgr_t vpm, vprocmgr_t *vpm_parent); + +vproc_err_t vprocmgr_get_all_vprocs(vprocmgr_t vpm, vproc_t **vps, size_t *vp_cnt); + +vproc_err_t vprocmgr_lookup_vproc(vprocmgr_t vpm, const char *label, vproc_t *vp); + +vproc_err_t vprocmgr_lookup_vprocmgr_for_user(vprocmgr_t vpm, const char *user, vprocmgr_t *vpm); + +vproc_err_t vprocmgr_lookup_mach_service(vprocmgr_t vpm, const char *service, mach_port_t *service_port); + +/* For controlling speculative and optimistical spawning of vprocs */ +vproc_err_t vprocmgr_set_force_on_demand(vproc_mgr_t vpm, bool force); +vproc_err_t vprocmgr_get_force_on_demand(vproc_mgr_t vpm, bool *force); + +/* Only release those vprocmgr_t objects that returned from APIs. */ +vproc_err_t vprocmgr_release(vprocmgr_t vpm); + + +/* Get meta-data and IPC handles from launchd */ +vproc_err_t vproc_checkin(launch_data_t *out); + +/* Get only meta-data from launchd */ +vproc_err_t vproc_get_info(vproc_t vp, launch_data_t *out); + +/* Lookup a Mach service amongst our peers and progenitors */ +vproc_err_t vproc_lookup_mach_service(vproc_t vp, const char *service, mach_port_t *service_port); + +/* Sending signals to a program that isn't running will return an error */ +vproc_err_t vproc_send_signal(vproc_t vp, int signum); + +/* Only release those vproc_t objects that returned from APIs. */ +vproc_err_t vproc_release(vproc_t vp); + + + +const char *vproc_strerror(vproc_err_t r); + +__END_DECLS + +#endif -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.macosforge.org/pipermail/launchd-changes/attachments/20060928/55057c02/attachment.html