Skip to content
Snippets Groups Projects
Unverified Commit f73c4897 authored by Jeremy Huddleston Sequoia's avatar Jeremy Huddleston Sequoia
Browse files

xquartz: Fix some formatting

parent 3fd87692
No related branches found
No related tags found
No related merge requests found
......@@ -60,17 +60,15 @@ aslclient aslc;
static void
set_x11_path(void)
{
OSStatus osstatus =
LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(
kX11AppBundleId), nil, &x11_appRef, &x11appURL);
OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId),
nil, &x11_appRef, &x11appURL);
switch (osstatus) {
case noErr:
if (x11appURL == NULL) {
asl_log(
aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Invalid response from LSFindApplicationForInfo(%s)",
kX11AppBundleId);
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Invalid response from LSFindApplicationForInfo(%s)",
kX11AppBundleId);
exit(1);
}
break;
......@@ -84,8 +82,7 @@ set_x11_path(void)
default:
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Unable to find application for %s, error code = %d",
kX11AppBundleId,
(int)osstatus);
kX11AppBundleId, (int)osstatus);
exit(11);
}
}
......@@ -110,18 +107,15 @@ connect_to_socket(const char *filename)
ret_fd = socket(PF_UNIX, SOCK_STREAM, 0);
if (ret_fd == -1) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Failed to create socket: %s - %s", filename,
strerror(
errno));
"Xquartz: Failed to create socket: %s - %d - %s",
filename, errno, strerror(errno));
return -1;
}
if (connect(ret_fd, servaddr, servaddr_len) < 0) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Failed to connect to socket: %s - %d - %s",
filename, errno,
strerror(
errno));
filename, errno, strerror(errno));
close(ret_fd);
return -1;
}
......@@ -164,10 +158,9 @@ send_fd_handoff(int connected_fd, int launchd_fd)
*((int *)CMSG_DATA(cmsg)) = launchd_fd;
if (sendmsg(connected_fd, &msg, 0) < 0) {
asl_log(
aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Error sending $DISPLAY file descriptor over fd %d: %d -- %s",
connected_fd, errno, strerror(errno));
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Error sending $DISPLAY file descriptor over fd %d: %d -- %s",
connected_fd, errno, strerror(errno));
return;
}
......@@ -270,8 +263,7 @@ main(int argc, char **argv, char **envp)
if (kr != KERN_SUCCESS) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: bootstrap_look_up(): %s", bootstrap_strerror(
kr));
"Xquartz: bootstrap_look_up(): %s", bootstrap_strerror(kr));
return EXIT_FAILURE;
}
}
......@@ -285,13 +277,10 @@ main(int argc, char **argv, char **envp)
int handoff_fd = -1;
for (try = 0, try_max = 5; try < try_max; try++) {
if (request_fd_handoff_socket(mp,
handoff_socket_filename) !=
KERN_SUCCESS) {
asl_log(
aslc, NULL, ASL_LEVEL_INFO,
"Xquartz: Failed to request a socket from the server to send the $DISPLAY fd over (try %d of %d)",
(int)try + 1, (int)try_max);
if (request_fd_handoff_socket(mp, handoff_socket_filename) != KERN_SUCCESS) {
asl_log(aslc, NULL, ASL_LEVEL_INFO,
"Xquartz: Failed to request a socket from the server to send the $DISPLAY fd over (try %d of %d)",
(int)try + 1, (int)try_max);
continue;
}
......@@ -299,16 +288,13 @@ main(int argc, char **argv, char **envp)
if (handoff_fd == -1) {
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Failed to connect to socket (try %d of %d)",
(int)try + 1,
(int)try_max);
(int)try + 1, (int)try_max);
continue;
}
asl_log(
aslc, NULL, ASL_LEVEL_INFO,
"Xquartz: Handoff connection established (try %d of %d) on fd %d, \"%s\". Sending message.",
(int)try + 1, (int)try_max, handoff_fd,
handoff_socket_filename);
asl_log(aslc, NULL, ASL_LEVEL_INFO,
"Xquartz: Handoff connection established (try %d of %d) on fd %d, \"%s\". Sending message.",
(int)try + 1, (int)try_max, handoff_fd, handoff_socket_filename);
send_fd_handoff(handoff_fd, launchd_fd);
close(handoff_fd);
break;
......@@ -329,8 +315,7 @@ main(int argc, char **argv, char **envp)
free(newargv);
free(newenvp);
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Memory allocation failure");
asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: Memory allocation failure");
return EXIT_FAILURE;
}
......@@ -348,8 +333,7 @@ main(int argc, char **argv, char **envp)
if (kr != KERN_SUCCESS) {
asl_log(aslc, NULL, ASL_LEVEL_ERR, "Xquartz: start_x11_server: %s",
mach_error_string(
kr));
mach_error_string(kr));
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment