summaryrefslogtreecommitdiff
path: root/launchd
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-04-18 09:47:33 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-18 09:47:33 -0700
commit4cd122efcfa47afbe8c2ebeee6d8fd48914839a7 (patch)
tree0f38b9edded5ed5ecc50a5237bd18d29d8b5c060 /launchd
parent2d9bdc819adbe45ec3ffdc72429fd92b7f613601 (diff)
launchd: Provide more verbose error reporting for launchd checkin failures
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'launchd')
-rw-r--r--launchd/privileged_startx/server.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/launchd/privileged_startx/server.c b/launchd/privileged_startx/server.c
index cfbb623..a93cae3 100644
--- a/launchd/privileged_startx/server.c
+++ b/launchd/privileged_startx/server.c
@@ -125,9 +125,19 @@ int server_main(const char *dir) {
aslclient aslc;
checkin = launch_data_new_string(LAUNCH_KEY_CHECKIN);
+ if (!checkin) {
+ asl_log(NULL, NULL, ASL_LEVEL_ERR, "unable to create launchd checkin string");
+ exit(EXIT_FAILURE);
+ }
+
config = launch_msg(checkin);
- if (!config || launch_data_get_type(config) == LAUNCH_DATA_ERRNO) {
- asl_log(NULL, NULL, ASL_LEVEL_ERR, "launchd checkin failed");
+ if (!config) {
+ asl_log(NULL, NULL, ASL_LEVEL_ERR, "could not send a message to launchd");
+ exit(EXIT_FAILURE);
+ }
+
+ if (launch_data_get_type(config) == LAUNCH_DATA_ERRNO) {
+ asl_log(NULL, NULL, ASL_LEVEL_ERR, "launchd checkin failed eith error: %d %s", launch_data_get_errno(config), strerror(launch_data_get_errno(config)));
exit(EXIT_FAILURE);
}