summaryrefslogtreecommitdiff
path: root/launchd/user_startx
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-05-12 20:27:55 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-05-12 20:27:55 -0700
commit3b53d7aecb2f3a729c57f2831a3d4b6e1ff1901f (patch)
treedc11bd4036d99fb57a1b70ca0d44f653aa8aab1a /launchd/user_startx
parente6187b0d47722ec364372926d78dfe4e5637bd6c (diff)
launchd: Update console redirection to work with libdispatch
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'launchd/user_startx')
-rw-r--r--launchd/user_startx/Makefile.am6
-rw-r--r--launchd/user_startx/launchd_startx.c7
2 files changed, 7 insertions, 6 deletions
diff --git a/launchd/user_startx/Makefile.am b/launchd/user_startx/Makefile.am
index f55a474..ce00e73 100644
--- a/launchd/user_startx/Makefile.am
+++ b/launchd/user_startx/Makefile.am
@@ -25,11 +25,11 @@ xinitrcdir = $(XINITDIR)
xinitrc_PROGRAMS = launchd_startx
-AM_CPPFLAGS = -DXINITDIR=\"$(xinitrcdir)\" -DBINDIR=\"$(bindir)\"
+AM_CPPFLAGS = -I$(srcdir)/.. -DXINITDIR=\"$(xinitrcdir)\" -DBINDIR=\"$(bindir)\"
dist_launchd_startx_SOURCES = \
- ../console_redirect.c \
- launchd_startx.c
+ $(srcdir)/../console_redirect.c \
+ launchd_startx.c
CPP_FILES_FLAGS = \
-D__xinitrcdir__="$(xinitrcdir)" \
diff --git a/launchd/user_startx/launchd_startx.c b/launchd/user_startx/launchd_startx.c
index 3d1e03e..e3fae76 100644
--- a/launchd/user_startx/launchd_startx.c
+++ b/launchd/user_startx/launchd_startx.c
@@ -39,8 +39,7 @@
#include <string.h>
#include <stdlib.h>
-/* console_redirect.c */
-extern int console_redirect(aslclient aslc, aslmsg amsg, int stdout_level, int stderr_level);
+#include "console_redirect.h"
int main(int argc, char **argv, char **envp) {
aslclient aslc;
@@ -53,7 +52,9 @@ int main(int argc, char **argv, char **envp) {
}
aslc = asl_open(BUNDLE_ID_PREFIX".startx", BUNDLE_ID_PREFIX, ASL_OPT_NO_DELAY);
- (void)console_redirect(aslc, NULL, ASL_LEVEL_INFO, ASL_LEVEL_NOTICE);
+
+ xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
+ xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
assert(posix_spawnp(&child, argv[1], NULL, NULL, &argv[1], envp) == 0);