summaryrefslogtreecommitdiff
path: root/launchd
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2012-04-18 09:20:37 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-04-18 09:32:31 -0700
commit2d9bdc819adbe45ec3ffdc72429fd92b7f613601 (patch)
treef063770c1b806fb8a61b0e87f7d8c89cf58e04d6 /launchd
parent49cfa8b7253096d24b2ef6a8d0ba32c4bae9ac23 (diff)
launchd: Don't provide the LaunchAgent on Tiger
Tiger's launchd doesn't support all the features we need from it. Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'launchd')
-rw-r--r--launchd/Makefile.am7
-rw-r--r--launchd/user_startx/launchd_startx.c23
2 files changed, 7 insertions, 23 deletions
diff --git a/launchd/Makefile.am b/launchd/Makefile.am
index f8781ed..0135b7f 100644
--- a/launchd/Makefile.am
+++ b/launchd/Makefile.am
@@ -1,3 +1,8 @@
-SUBDIRS = privileged_startx user_startx
+DIST_SUBDIRS = privileged_startx user_startx
+SUBDIRS = privileged_startx
+
+if !TIGER_LAUNCHD
+SUBDIRS += user_startx
+endif
EXTRA_DIST = console_redirect.h
diff --git a/launchd/user_startx/launchd_startx.c b/launchd/user_startx/launchd_startx.c
index f83cd61..67419a4 100644
--- a/launchd/user_startx/launchd_startx.c
+++ b/launchd/user_startx/launchd_startx.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011 Apple Inc.
+/* Copyright (c) 2011-2012 Apple Inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation files
@@ -37,15 +37,7 @@
#include <sys/wait.h>
#include <string.h>
#include <stdlib.h>
-
-/* Using MIN_REQUIRED instead of MAX_ALLOWED logic due to posix_spawn not
- * being marked with availability macros until 10.7
- */
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
#include <spawn.h>
-#else
-#include <errno.h>
-#endif
#include "console_redirect.h"
@@ -64,20 +56,7 @@ int main(int argc, char **argv, char **envp) {
xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
assert(posix_spawnp(&child, argv[1], NULL, NULL, &argv[1], envp) == 0);
-#else
- switch(child = fork()) {
- case -1:
- perror("fork");
- return errno;
- case 0:
- return execvp(argv[1], &argv[1]);
- default:
- break;
- }
-#endif
-
wait4(child, &pstat, 0, (struct rusage *)0);
return pstat;