aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/mach-startup/launchd_fd.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-28 09:11:07 +0200
committermarha <marha@users.sourceforge.net>2012-03-28 09:11:07 +0200
commit9b51c6da8bffdd67353b1e1245698a7eac478481 (patch)
treecde44c263cb1756fae5b4a83facb3c0cdfa474e4 /xorg-server/hw/xquartz/mach-startup/launchd_fd.c
parentfb2b04331b6ae2cd11f6132cf16f6fcd848fb6b8 (diff)
parentec617f09d07e32d6f57c0da133f53ad3d43a568a (diff)
downloadvcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.tar.gz
vcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.tar.bz2
vcxsrv-9b51c6da8bffdd67353b1e1245698a7eac478481.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'xorg-server/hw/xquartz/mach-startup/launchd_fd.c')
-rw-r--r--xorg-server/hw/xquartz/mach-startup/launchd_fd.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/xorg-server/hw/xquartz/mach-startup/launchd_fd.c b/xorg-server/hw/xquartz/mach-startup/launchd_fd.c
index fd1d276e3..15866cc42 100644
--- a/xorg-server/hw/xquartz/mach-startup/launchd_fd.c
+++ b/xorg-server/hw/xquartz/mach-startup/launchd_fd.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008 Apple Inc.
+/* Copyright (c) 2008-2012 Apple Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
@@ -45,30 +45,35 @@ launchd_display_fd(void)
launch_data_t listening_fd_array, listening_fd;
/* Get launchd fd */
- if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) == NULL) {
- asl_log(aslc, NULL, ASL_LEVEL_ERR,
- "launch_data_new_string(\"" LAUNCH_KEY_CHECKIN
- "\") Unable to create string.\n");
+ if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) ==
+ NULL) {
+ asl_log(
+ aslc, NULL, ASL_LEVEL_ERR,
+ "launch_data_new_string(\"" LAUNCH_KEY_CHECKIN
+ "\") Unable to create string.\n");
return ERROR_FD;
}
if ((checkin_response = launch_msg(checkin_request)) == NULL) {
asl_log(aslc, NULL, ASL_LEVEL_WARNING,
"launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",
- strerror(errno));
+ strerror(
+ errno));
return ERROR_FD;
}
if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) {
// ignore EACCES, which is common if we weren't started by launchd
if (launch_data_get_errno(checkin_response) != EACCES)
- asl_log(aslc, NULL, ASL_LEVEL_ERR, "launchd check-in failed: %s\n",
- strerror(launch_data_get_errno(checkin_response)));
+ asl_log(aslc, NULL, ASL_LEVEL_ERR,
+ "launchd check-in failed: %s\n",
+ strerror(launch_data_get_errno(
+ checkin_response)));
return ERROR_FD;
}
- sockets_dict =
- launch_data_dict_lookup(checkin_response, LAUNCH_JOBKEY_SOCKETS);
+ sockets_dict = launch_data_dict_lookup(checkin_response,
+ LAUNCH_JOBKEY_SOCKETS);
if (NULL == sockets_dict) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"launchd check-in: no sockets found to answer requests on!\n");
@@ -81,14 +86,15 @@ launchd_display_fd(void)
return ERROR_FD;
}
- listening_fd_array =
- launch_data_dict_lookup(sockets_dict, BUNDLE_ID_PREFIX ":0");
+ listening_fd_array = launch_data_dict_lookup(sockets_dict,
+ BUNDLE_ID_PREFIX ":0");
if (NULL == listening_fd_array) {
listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0");
if (NULL == listening_fd_array) {
- asl_log(aslc, NULL, ASL_LEVEL_ERR,
- "launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n",
- BUNDLE_ID_PREFIX);
+ asl_log(
+ aslc, NULL, ASL_LEVEL_ERR,
+ "launchd check-in: No known sockets found to answer requests on! \"%s:0\" and \":0\" failed.\n",
+ BUNDLE_ID_PREFIX);
return ERROR_FD;
}
}
@@ -96,7 +102,8 @@ launchd_display_fd(void)
if (launch_data_array_get_count(listening_fd_array) != 1) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"launchd check-in: Expected 1 socket from launchd, got %u)\n",
- (unsigned) launch_data_array_get_count(listening_fd_array));
+ (unsigned)launch_data_array_get_count(
+ listening_fd_array));
return ERROR_FD;
}