summaryrefslogtreecommitdiff
path: root/launchd/user_startx/launchd_startx.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@herrb.eu>2021-05-22 18:23:15 +0200
committerMatthieu Herrb <matthieu@herrb.eu>2021-05-22 18:23:15 +0200
commitd5a136c4fa562d66efd7d20bf2ba40d1a62439fa (patch)
treed681ee32405dbdccc6116dec603d44fb6a2a07a6 /launchd/user_startx/launchd_startx.c
parent809a2659e31ee637eddefffa5af3738fcd60a79d (diff)
parentae77976adaae9948e3e8d7a673dc88df4e31de46 (diff)
Merge remote-tracking branch 'origin/master' into obsd
Diffstat (limited to 'launchd/user_startx/launchd_startx.c')
-rw-r--r--launchd/user_startx/launchd_startx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/launchd/user_startx/launchd_startx.c b/launchd/user_startx/launchd_startx.c
index 67419a4..e2589be 100644
--- a/launchd/user_startx/launchd_startx.c
+++ b/launchd/user_startx/launchd_startx.c
@@ -39,8 +39,6 @@
#include <stdlib.h>
#include <spawn.h>
-#include "console_redirect.h"
-
int main(int argc, char **argv, char **envp) {
aslclient aslc;
pid_t child;
@@ -53,8 +51,13 @@ int main(int argc, char **argv, char **envp) {
aslc = asl_open(BUNDLE_ID_PREFIX".startx", BUNDLE_ID_PREFIX, ASL_OPT_NO_DELAY);
- xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
- xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
+ asl_log_descriptor(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO, ASL_LOG_DESCRIPTOR_WRITE);
+ asl_log_descriptor(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO, ASL_LOG_DESCRIPTOR_WRITE);
+
+ /* https://github.com/XQuartz/XQuartz/issues/114 */
+ char const * const home = getenv("HOME");
+ assert(home);
+ chdir(home);
assert(posix_spawnp(&child, argv[1], NULL, NULL, &argv[1], envp) == 0);
wait4(child, &pstat, 0, (struct rusage *)0);