Makefile.am | 7 - configure.ac | 13 -- org.x.startx.plist.cpp | 5 privileged_startx/20-font_cache.cpp | 4 privileged_startx/Makefile.am | 9 + privileged_startx/client.c | 6 + privileged_startx/org.x.privileged_startx.plist.cpp | 19 ++- privileged_startx/server.c | 68 ++++++++++-- startx.cpp | 111 +++++++++++--------- xinit.c | 40 ++++++- 10 files changed, 195 insertions(+), 87 deletions(-)
New commits: commit 46d641fdd020d07a9b4bd0364cf126643342a7e3 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed Dec 17 15:19:38 2008 -0800 xinit 1.1.1 diff --git a/configure.ac b/configure.ac index 86bd1f2..78b8827 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(xinit,[1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit) +AC_INIT(xinit,[1.1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE commit c340932db548d1a3d4fc5bbc682b7730e5b2cf4a Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed Dec 17 13:00:23 2008 -0800 Apple: Allow defaults option that maps to a -dpi server command line in startx diff --git a/startx.cpp b/startx.cpp index 529366d..8a44965 100644 --- a/startx.cpp +++ b/startx.cpp @@ -128,6 +128,10 @@ if [ x`defaults read $X11_PREFS_DOMAIN nolisten_tcp` = x1 ] ; then defaultserverargs="$defaultserverargs -nolisten tcp" fi +if defaults read $X11_PREFS_DOMAIN dpi >& /dev/null ; then + defaultserverargs="$defaultserverargs -dpi `defaults read $X11_PREFS_DOMAIN dpi`" +fi + for ((d=0; ; d++)) ; do [[ -e /tmp/.X$d-lock ]] || break done commit 89c1675d128da3477cac6858c4249b839ec68346 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Sat Dec 13 00:14:54 2008 -0800 OSX: Don't use login/bash -c hack anymore for org.x.startx LaunchAgent diff --git a/org.x.startx.plist.cpp b/org.x.startx.plist.cpp index 4bcedcf..4f3ce74 100644 --- a/org.x.startx.plist.cpp +++ b/org.x.startx.plist.cpp @@ -6,9 +6,6 @@ <string>org.x.startx</string> <key>ProgramArguments</key> <array> - <string>/bin/bash</string> - <string>--login</string> - <string>-c</string> <string>__bindir__/startx</string> </array> <key>Sockets</key> commit 13accec7614960965470f17894bc9212842ea6d7 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Tue Dec 9 21:15:13 2008 -0800 OSX: More prefix fixes diff --git a/startx.cpp b/startx.cpp index fb23f18..529366d 100644 --- a/startx.cpp +++ b/startx.cpp @@ -103,12 +103,12 @@ fi XCOMM First, start caching fonts if [ x`defaults read $X11_PREFS_DOMAIN cache_fonts` = x1 ] ; then - if [ -x /usr/X11/bin/font_cache ] ; then - /usr/X11/bin/font_cache & - elif [ -x /usr/X11/bin/font_cache.sh ] ; then - /usr/X11/bin/font_cache.sh & - elif [ -x /usr/X11/bin/fc-cache ] ; then - /usr/X11/bin/fc-cache & + if [ -x $bindir/font_cache ] ; then + $bindir/font_cache & + elif [ -x $bindir/font_cache.sh ] ; then + $bindir/font_cache.sh & + elif [ -x $bindir/fc-cache ] ; then + $bindir/fc-cache & fi fi commit e06ebf63e2c91e590fc1091e5ea2e49bab835526 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed Dec 3 11:19:48 2008 -0800 OSX: Fixed bad prefix diff --git a/privileged_startx/20-font_cache.cpp b/privileged_startx/20-font_cache.cpp index c13384b..6d43e10 100755 --- a/privileged_startx/20-font_cache.cpp +++ b/privileged_startx/20-font_cache.cpp @@ -27,9 +27,9 @@ XCOMM promote the sale, use or other dealings in this Software without XCOMM prior written authorization. if [ -x BINDIR/font_cache ] ; then - BINDIR/font_cache & + BINDIR/font_cache -s & elif [ -x BINDIR/font_cache.sh ] ; then BINDIR/font_cache.sh -s & -elif [ -x /usr/X11/bin/fc-cache ] ; then +elif [ -x BINDIR/fc-cache ] ; then BINDIR/fc-cache & fi commit 4ee72a6f1fc5d045adb71260107ca605ec68a84a Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Tue Dec 2 20:56:11 2008 -0800 OSX Tiger: Fix discovery of mach port diff --git a/privileged_startx/server.c b/privileged_startx/server.c index bfe7ca4..6dd4f2b 100644 --- a/privileged_startx/server.c +++ b/privileged_startx/server.c @@ -153,10 +153,6 @@ int server_main(const char *dir) { mp = launch_data_get_machport(svc); #else - kr = bootstrap_check_in(bootstrap_port, "org.x.X11", &mp); - if (kr == KERN_SUCCESS) - return mp; - mp = checkin_or_register("org.x.privileged_startx"); #endif commit ca9cb9750d2dd480240a37cdbd94fdba0a34da4c Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Tue Dec 2 20:31:10 2008 -0800 Apple: Honor X11_PREFS_DOMAIN if it's set (1.4.2-apple26 and later) diff --git a/startx.cpp b/startx.cpp index 5ff62a0..fb23f18 100644 --- a/startx.cpp +++ b/startx.cpp @@ -84,21 +84,25 @@ serverargs="" #ifdef __APPLE__ +if [ "x$X11_PREFS_DOMAIN" = x ] ; then + X11_PREFS_DOMAIN="org.x.X11" +fi + XCOMM Initialize defaults (this will cut down on "safe" error messages) -if ! defaults read org.x.X11 cache_fonts >& /dev/null ; then - defaults write org.x.X11 cache_fonts -bool true +if ! defaults read $X11_PREFS_DOMAIN cache_fonts >& /dev/null ; then + defaults write $X11_PREFS_DOMAIN cache_fonts -bool true fi -if ! defaults read org.x.X11 no_auth >& /dev/null ; then - defaults write org.x.X11 no_auth -bool false +if ! defaults read $X11_PREFS_DOMAIN no_auth >& /dev/null ; then + defaults write $X11_PREFS_DOMAIN no_auth -bool false fi -if ! defaults read org.x.X11 nolisten_tcp >& /dev/null ; then - defaults write org.x.X11 nolisten_tcp -bool true +if ! defaults read $X11_PREFS_DOMAIN nolisten_tcp >& /dev/null ; then + defaults write $X11_PREFS_DOMAIN nolisten_tcp -bool true fi XCOMM First, start caching fonts -if [ x`defaults read org.x.X11 cache_fonts` = x1 ] ; then +if [ x`defaults read $X11_PREFS_DOMAIN cache_fonts` = x1 ] ; then if [ -x /usr/X11/bin/font_cache ] ; then /usr/X11/bin/font_cache & elif [ -x /usr/X11/bin/font_cache.sh ] ; then @@ -114,13 +118,13 @@ if [ -x XINITDIR/privileged_startx ] ; then XINITDIR/privileged_startx fi -if [ x`defaults read org.x.X11 no_auth` = x0 ] ; then +if [ x`defaults read $X11_PREFS_DOMAIN no_auth` = x0 ] ; then enable_xauth=1 else enable_xauth=0 fi -if [ x`defaults read org.x.X11 nolisten_tcp` = x1 ] ; then +if [ x`defaults read $X11_PREFS_DOMAIN nolisten_tcp` = x1 ] ; then defaultserverargs="$defaultserverargs -nolisten tcp" fi commit 754efe651165ea7dd034f6b0ce75ef785deab826 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Fri Nov 28 23:23:14 2008 -0800 OSX Tiger: Hopefully the last fix for Tiger users... diff --git a/privileged_startx/client.c b/privileged_startx/client.c index 2a24a70..a33dd02 100644 --- a/privileged_startx/client.c +++ b/privileged_startx/client.c @@ -34,6 +34,8 @@ #include <stdlib.h> #include <stdbool.h> +#include <AvailabilityMacros.h> + #include "privileged_startx.h" int client_main(void) { @@ -42,7 +44,11 @@ int client_main(void) { kr = bootstrap_look_up(bootstrap_port, BOOTSTRAP_NAME, &mp); if (kr != KERN_SUCCESS) { +#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 fprintf(stderr, "bootstrap_look_up(): %s\n", bootstrap_strerror(kr)); +#else + fprintf(stderr, "bootstrap_look_up(): %ul\n", (unsigned long)kr); +#endif exit(EXIT_FAILURE); } commit f04db53e71c681379ec49494c9ab727bc5269b30 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Fri Nov 28 11:20:25 2008 -0800 OSX Tiger: More compilation fixes... diff --git a/privileged_startx/server.c b/privileged_startx/server.c index d0356b5..bfe7ca4 100644 --- a/privileged_startx/server.c +++ b/privileged_startx/server.c @@ -153,7 +153,7 @@ int server_main(const char *dir) { mp = launch_data_get_machport(svc); #else - kr = bootstrap_check_in(bootstrap_port, bname, &mp); + kr = bootstrap_check_in(bootstrap_port, "org.x.X11", &mp); if (kr == KERN_SUCCESS) return mp; @@ -209,8 +209,10 @@ kern_return_t do_privileged_startx(mach_port_t test_port __attribute__((unused)) const char * path_argv[2] = {script_dir, NULL}; +#ifdef LAUNCH_JOBKEY_MACHSERVICES /* Store that we were called, so the idle timer will reset */ gettimeofday(&idle_globals.lastmsg, NULL); +#endif /* script_dir contains a set of files to run with root privs when X11 starts */ ftsp = fts_open(path_argv, FTS_PHYSICAL, ftscmp); commit ed6dc88f5cbaaad08a282c44ae333a938f6f4216 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Thu Nov 27 00:47:31 2008 -0800 OSX: Create privleged_startx on Tiger Launchd in Tiger doesn't support OnDemand loading, so this is a KeepAlive idle daemon on Tiger. diff --git a/configure.ac b/configure.ac index 2d09cad..86bd1f2 100644 --- a/configure.ac +++ b/configure.ac @@ -102,18 +102,17 @@ AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], if test "x$LAUNCHD" = "xauto"; then unset LAUNCHD - case $host_os in - darwin8*) - LAUNCHD=no - ;; - *) - AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no]) - ;; - esac + AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no]) fi +TIGER_LAUNCHD=no if test "x$LAUNCHD" = "xyes" ; then AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available]) + case $host_os in + darwin8*) + TIGER_LAUNCHD=yes + ;; + esac else launchagentsdir="" launchdaemonsdir="" @@ -121,6 +120,7 @@ fi AC_SUBST([launchagentsdir]) AC_SUBST([launchdaemonsdir]) AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"]) +AM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"]) # Checks for pkg-config packages PKG_CHECK_MODULES(XINIT, x11) diff --git a/privileged_startx/Makefile.am b/privileged_startx/Makefile.am index f561bf4..2d68544 100644 --- a/privileged_startx/Makefile.am +++ b/privileged_startx/Makefile.am @@ -34,9 +34,12 @@ xinitrc_PROGRAMS = privileged_startx privstartx_SCRIPTS = 10-tmpdirs 20-font_cache AM_CPPFLAGS = -DXINITDIR=\"$(xinitrcdir)\" -DSCRIPTDIR=\"$(privstartxdir)\" -DBINDIR=\"$(bindir)\" - CPP_FILES_FLAGS = -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)" +if TIGER_LAUNCHD +CPP_FILES_FLAGS += -DTIGER_LAUNCHD +endif + dist_privileged_startx_SOURCES = \ server.c \ client.c \ diff --git a/privileged_startx/org.x.privileged_startx.plist.cpp b/privileged_startx/org.x.privileged_startx.plist.cpp index fd87478..7400cc4 100644 --- a/privileged_startx/org.x.privileged_startx.plist.cpp +++ b/privileged_startx/org.x.privileged_startx.plist.cpp @@ -4,20 +4,25 @@ <dict> <key>Label</key> <string>org.x.privileged_startx</string> - <key>MachServices</key> - <dict> - <key>org.x.privileged_startx</key> - <true/> - </dict> <key>ProgramArguments</key> <array> <string>XINITDIR/privileged_startx</string> <string>-d</string> <string>SCRIPTDIR</string> </array> +#ifdef TIGER_LAUNCHD + <key>KeepAlive</key> + <true/> +#else + <key>MachServices</key> + <dict> + <key>org.x.privileged_startx</key> + <true/> + </dict> <key>TimeOut</key> <integer>120</integer> <key>EnableTransactions</key> <true/> +#endif </dict> </plist> diff --git a/privileged_startx/server.c b/privileged_startx/server.c index 7afd424..d0356b5 100644 --- a/privileged_startx/server.c +++ b/privileged_startx/server.c @@ -40,7 +40,6 @@ #include <sys/time.h> #include <launch.h> #include <asl.h> -#include <pthread.h> #include <errno.h> #include "privileged_startx.h" @@ -51,6 +50,10 @@ union MaxMsgSize { union __ReplyUnion__privileged_startx_subsystem rep; }; +#ifdef LAUNCH_JOBKEY_MACHSERVICES +#include <pthread.h> +static void* idle_thread(void* param __attribute__((unused))); + /* globals to trigger idle exit */ #define DEFAULT_IDLE_TIMEOUT 60 /* 60 second timeout, then the server exits */ @@ -61,6 +64,7 @@ struct idle_globals { }; struct idle_globals idle_globals; +#endif #ifndef SCRIPTDIR #define SCRIPTDIR="/usr/X11/lib/X11/xinit/privileged_startx.d" @@ -69,13 +73,46 @@ struct idle_globals idle_globals; /* Default script dir */ const char *script_dir = SCRIPTDIR; -static void* idle_thread(void* param __attribute__((unused))); +#ifndef LAUNCH_JOBKEY_MACHSERVICES +static mach_port_t checkin_or_register(char *bname) { + kern_return_t kr; + mach_port_t mp; + + /* If we're started by launchd or the old mach_init */ + kr = bootstrap_check_in(bootstrap_port, bname, &mp); + if (kr == KERN_SUCCESS) + return mp; + + /* We probably were not started by launchd or the old mach_init */ + kr = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &mp); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "mach_port_allocate(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + kr = mach_port_insert_right(mach_task_self(), mp, mp, MACH_MSG_TYPE_MAKE_SEND); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "mach_port_insert_right(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + kr = bootstrap_register(bootstrap_port, bname, mp); + if (kr != KERN_SUCCESS) { + fprintf(stderr, "bootstrap_register(): %s\n", mach_error_string(kr)); + exit(EXIT_FAILURE); + } + + return mp; +} +#endif int server_main(const char *dir) { mach_msg_size_t mxmsgsz = sizeof(union MaxMsgSize) + MAX_TRAILER_SIZE; mach_port_t mp; kern_return_t kr; +#ifdef LAUNCH_JOBKEY_MACHSERVICES long idle_timeout = DEFAULT_IDLE_TIMEOUT; +#endif launch_data_t config = NULL, checkin = NULL; checkin = launch_data_new_string(LAUNCH_KEY_CHECKIN); @@ -85,6 +122,13 @@ int server_main(const char *dir) { exit(EXIT_FAILURE); } + if(dir) { + script_dir = dir; + asl_log(NULL, NULL, ASL_LEVEL_DEBUG, + "script directory set: %s", script_dir); + } + +#ifdef LAUNCH_JOBKEY_MACHSERVICES launch_data_t tmv; tmv = launch_data_dict_lookup(config, LAUNCH_JOBKEY_TIMEOUT); if (tmv) { @@ -93,12 +137,6 @@ int server_main(const char *dir) { "idle timeout set: %ld seconds", idle_timeout); } - if(dir) { - script_dir = dir; - asl_log(NULL, NULL, ASL_LEVEL_DEBUG, - "script directory set: %s", script_dir); - } - launch_data_t svc; svc = launch_data_dict_lookup(config, LAUNCH_JOBKEY_MACHSERVICES); if (!svc) { @@ -114,6 +152,14 @@ int server_main(const char *dir) { } mp = launch_data_get_machport(svc); +#else + kr = bootstrap_check_in(bootstrap_port, bname, &mp); + if (kr == KERN_SUCCESS) + return mp; + + mp = checkin_or_register("org.x.privileged_startx"); +#endif + if (mp == MACH_PORT_NULL) { asl_log(NULL, NULL, ASL_LEVEL_ERR, "NULL mach service: %s", BOOTSTRAP_NAME); @@ -129,12 +175,14 @@ int server_main(const char *dir) { exit(EXIT_FAILURE); } +#ifdef LAUNCH_JOBKEY_MACHSERVICES /* spawn a thread to monitor our idle timeout */ pthread_t thread; idle_globals.mp = mp; idle_globals.timeout = idle_timeout; gettimeofday(&idle_globals.lastmsg, NULL); pthread_create(&thread, NULL, &idle_thread, NULL); +#endif /* Main event loop */ kr = mach_msg_server(privileged_startx_server, mxmsgsz, mp, 0); @@ -222,6 +270,7 @@ kern_return_t do_privileged_startx(mach_port_t test_port __attribute__((unused)) } kern_return_t do_idle_exit(mach_port_t test_port __attribute__((unused))) { +#ifdef LAUNCH_JOBKEY_MACHSERVICES struct timeval now; gettimeofday(&now, NULL); @@ -231,8 +280,12 @@ kern_return_t do_idle_exit(mach_port_t test_port __attribute__((unused))) { } return KERN_SUCCESS; +#else + return KERN_FAILURE; +#endif } +#ifdef LAUNCH_JOBKEY_MACHSERVICES static void *idle_thread(void* param __attribute__((unused))) { for(;;) { struct timeval now; @@ -248,3 +301,4 @@ static void *idle_thread(void* param __attribute__((unused))) { } return NULL; } +#endif commit 9f761b5a8512a8ad8b1475a3684e1a23d953916f Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Sat Nov 22 10:52:35 2008 -0800 Apple: Use AvailabilityMacros.h for Tiger compatability diff --git a/xinit.c b/xinit.c index da155fd..d25de9d 100644 --- a/xinit.c +++ b/xinit.c @@ -61,7 +61,7 @@ in this Software without prior written authorization from The Open Group. #include <stdarg.h> #ifdef __APPLE__ -#include <Availability.h> +#include <AvailabilityMacros.h> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 #include <vproc.h> #endif commit 0c0b73812efe75496e154730787402538a268bac Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Thu Aug 28 19:10:59 2008 -0700 Apple: Make VPATH builds work on darwin Patch from Peter O'Gorman <pe...@pogma.com> diff --git a/privileged_startx/Makefile.am b/privileged_startx/Makefile.am index 6a143ca..f561bf4 100644 --- a/privileged_startx/Makefile.am +++ b/privileged_startx/Makefile.am @@ -70,5 +70,5 @@ EXTRA_DIST = \ privileged_startx.defs \ privileged_startx_types.h -$(BUILT_SOURCES): privileged_startx.defs - mig -sheader privileged_startxServer.h privileged_startx.defs +$(BUILT_SOURCES): $(srcdir)/privileged_startx.defs + mig -sheader privileged_startxServer.h $(srcdir)/privileged_startx.defs commit 0753882b89a451c9bdd053c2915a80fbcdbb0b77 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Tue Aug 5 14:58:48 2008 -0700 Apple: sleep() to avoid innocent error message spew diff --git a/xinit.c b/xinit.c index 0336a7b..da155fd 100644 --- a/xinit.c +++ b/xinit.c @@ -490,15 +490,23 @@ waitforserver(void) int ncycles = 120; /* # of cycles to wait */ int cycles; /* Wait cycle count */ +#ifdef __APPLE__ + /* For Apple, we don't get signaled by the server when it's ready, so we just + * want to sleep now since we're going to sleep later anyways and this allows us + * to avoid the awkard, "why is there an error message in the log" questions + * from users. + */ + + sleep(2); +#endif + for (cycles = 0; cycles < ncycles; cycles++) { if ((xd = XOpenDisplay(displayNum))) { return(TRUE); } else { -#define MSG "X server to begin accepting connections" - if (!processTimeout (1, MSG)) + if (!processTimeout (1, "X server to begin accepting connections")) break; -#undef MSG } } commit 79871c9b9daa1fad1b84af8f7eb54fced7526b2e Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Tue Aug 5 14:11:24 2008 -0700 Fix build of startx & xinitrc with Solaris make For some reason, having the dependencies explictly listed causes it to ignore the suffix implicit rule for .cpp. diff --git a/Makefile.am b/Makefile.am index 78ae154..0d831f3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -67,9 +67,6 @@ endif DIST_SUBDIRS = privileged_startx -xinitrc: xinitrc.cpp Makefile -startx: startx.cpp Makefile - xinitrc_DATA = xinitrc CLEANFILES = xinitrc startx $(appman_DATA) $(launchagents_DATA) commit 9cc39e441b8741b4b0b878d00e09f0366ff36146 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Mon Aug 4 14:40:49 2008 -0700 Support the instant-off API in SnowLeopard. diff --git a/org.x.startx.plist.cpp b/org.x.startx.plist.cpp index 42c9f70..4bcedcf 100644 --- a/org.x.startx.plist.cpp +++ b/org.x.startx.plist.cpp @@ -21,5 +21,7 @@ </dict> <key>ServiceIPC</key> <true/> + <key>EnableTransactions</key> + <true/> </dict> </plist> diff --git a/privileged_startx/org.x.privileged_startx.plist.cpp b/privileged_startx/org.x.privileged_startx.plist.cpp index d0e41a6..fd87478 100644 --- a/privileged_startx/org.x.privileged_startx.plist.cpp +++ b/privileged_startx/org.x.privileged_startx.plist.cpp @@ -17,5 +17,7 @@ </array> <key>TimeOut</key> <integer>120</integer> + <key>EnableTransactions</key> + <true/> </dict> </plist> diff --git a/xinit.c b/xinit.c index 523cfd5..0336a7b 100644 --- a/xinit.c +++ b/xinit.c @@ -60,6 +60,13 @@ in this Software without prior written authorization from The Open Group. #include <setjmp.h> #include <stdarg.h> +#ifdef __APPLE__ +#include <Availability.h> +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +#include <vproc.h> +#endif +#endif + #if !defined(SIGCHLD) && defined(SIGCLD) #define SIGCHLD SIGCLD #endif @@ -250,6 +257,11 @@ main(int argc, char *argv[], char *envp[]) int client_args_given = 0, server_args_given = 0; int start_of_client_args, start_of_server_args; struct sigaction sa; +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vproc_transaction_t vt; +#endif +#endif #ifdef __UNIXOS2__ envsave = envp; /* circumvent an EMX problem */ @@ -426,6 +438,13 @@ main(int argc, char *argv[], char *envp[]) signal(SIGALRM, sigAlarm); signal(SIGUSR1, sigUsr1); + +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vt = vproc_transaction_begin(NULL); +#endif +#endif + if (startServer(server) > 0 && startClient(client) > 0) { pid = -1; @@ -434,6 +453,13 @@ main(int argc, char *argv[], char *envp[]) ) pid = wait(NULL); } + +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vproc_transaction_end(NULL, vt); +#endif +#endif + signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); commit 7d41013b0e295ec0444c2f9099679bb6018c812f Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed Jul 2 16:36:24 2008 -0700 Apple: Using eval to protect people who have spaces in their home path. diff --git a/startx.cpp b/startx.cpp index 8950feb..5ff62a0 100644 --- a/startx.cpp +++ b/startx.cpp @@ -271,7 +271,11 @@ if [ x"$enable_xauth" = x1 ] ; then xauth -q -f "$xserverauthfile" << EOF add :$dummy . $mcookie EOF +#ifdef __APPLE__ + serverargs=${serverargs}" -auth '"${xserverauthfile}"'" +#else serverargs=${serverargs}" -auth "${xserverauthfile} +#endif XCOMM now add the same credentials to the client authority file XCOMM if '$displayname' already exists do not overwrite it as another @@ -300,9 +304,15 @@ else XINIT "$client" $clientargs -- "$server" $display $serverargs fi #else + +#ifdef __APPLE__ +eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs +#else XINIT "$client" $clientargs -- "$server" $display $serverargs #endif +#endif + if [ x"$enable_xauth" = x1 ] ; then if [ x"$removelist" != x ]; then XAUTH remove $removelist commit 9632367abd03108f3636b05e9f2fd92f5c28dabe Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Sun Jun 29 18:24:13 2008 -0700 startx.cpp: Made some things a little more friendly for people who have spaces in pathnames. diff --git a/startx.cpp b/startx.cpp index 8ffdc70..8950feb 100644 --- a/startx.cpp +++ b/startx.cpp @@ -133,19 +133,6 @@ defaultdisplay=":$d" enable_xauth=1 #endif - -if [ -f $userclientrc ]; then - defaultclientargs=$userclientrc -elif [ -f $sysclientrc ]; then - defaultclientargs=$sysclientrc -#if defined(__SCO__) || defined(__UNIXWARE__) -elif [ -f $scouserclientrc ]; then - defaultclientargs=$scouserclientrc -elif [ -f $scosysclientrc ]; then - defaultclientargs=$scosysclientrc -#endif -fi - #if defined(__SCO__) || defined(__UNIXWARE__) XCOMM SCO -t option: do not start an X server @@ -202,11 +189,23 @@ done XCOMM process client arguments if [ x"$client" = x ]; then + client=$defaultclient + XCOMM if no client arguments either, use rc file instead if [ x"$clientargs" = x ]; then - client="$defaultclientargs" - else - client=$defaultclient + if [ -f "$userclientrc" ]; then + client=$userclientrc + elif [ -f "$sysclientrc" ]; then + client=$sysclientrc +#if defined(__SCO__) || defined(__UNIXWARE__) + elif [ -f "$scouserclientrc" ]; then + client=$scouserclientrc + elif [ -f "$scosysclientrc" ]; then + client=$scosysclientrc +#endif + fi + + clientargs=$defaultclientargs fi fi @@ -217,9 +216,9 @@ if [ x"$server" = x ]; then XCOMM if no server arguments or display either, use defaults if [ x"$serverargs" = x -a x"$display" = x ]; then XCOMM For compatibility reasons, only use xserverrc if there were no server command line arguments - if [ -f $userserverrc ]; then + if [ -f "$userserverrc" ]; then server=$userserverrc - elif [ -f $sysserverrc ]; then + elif [ -f "$sysserverrc" ]; then server=$sysserverrc fi @@ -268,8 +267,8 @@ if [ x"$enable_xauth" = x1 ] ; then XCOMM create a file with auth information for the server. ':0' is a dummy. xserverauthfile=$HOME/.serverauth.$$ - trap "rm -f $xserverauthfile" HUP INT QUIT ILL TRAP KILL BUS TERM - xauth -q -f $xserverauthfile << EOF + trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM + xauth -q -f "$xserverauthfile" << EOF add :$dummy . $mcookie EOF serverargs=${serverargs}" -auth "${xserverauthfile} @@ -287,7 +286,7 @@ EOF removelist="$displayname $removelist" else dummy=$(($dummy+1)); - XAUTH -q -f $xserverauthfile << EOF + XAUTH -q -f "$xserverauthfile" << EOF add :$dummy . $authcookie EOF fi @@ -298,10 +297,10 @@ fi if [ "$REMOTE_SERVER" = "TRUE" ]; then exec SHELL_CMD ${client} else - XINIT $client $clientargs -- $server $display $serverargs + XINIT "$client" $clientargs -- "$server" $display $serverargs fi #else -XINIT $client $clientargs -- $server $display $serverargs +XINIT "$client" $clientargs -- "$server" $display $serverargs #endif if [ x"$enable_xauth" = x1 ] ; then @@ -309,7 +308,7 @@ if [ x"$enable_xauth" = x1 ] ; then XAUTH remove $removelist fi if [ x"$xserverauthfile" != x ]; then - rm -f $xserverauthfile + rm -f "$xserverauthfile" fi fi commit c5bd51b3a31b3b290dec9f978779a56161308bb4 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Sun Jun 29 17:50:44 2008 -0700 Apple: privleged_startx: Increase the timeout so slower machines don't get a stray process warning in their system log. diff --git a/privileged_startx/org.x.privileged_startx.plist.cpp b/privileged_startx/org.x.privileged_startx.plist.cpp index e878dc3..d0e41a6 100644 --- a/privileged_startx/org.x.privileged_startx.plist.cpp +++ b/privileged_startx/org.x.privileged_startx.plist.cpp @@ -16,6 +16,6 @@ <string>SCRIPTDIR</string> </array> <key>TimeOut</key> - <integer>60</integer> + <integer>120</integer> </dict> </plist> commit a5a8ea7c8452908c2c4c9c822f5b4f7382c03630 Author: Adam Jackson <a...@redhat.com> Date: Thu Jun 12 15:27:11 2008 -0400 xinit 1.1.0 diff --git a/configure.ac b/configure.ac index 6f6bf6c..2d09cad 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) -AC_INIT(xinit,[1.0.9], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit) +AC_INIT(xinit,[1.1.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xinit) AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE commit 44e2ee01b456deb2630d21786d19ee2734d2f40a Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed May 28 12:01:35 2008 -0700 Apple: Don't use launchd on Tiger since it doesn't support the features we need. https://bugs.freedesktop.org/show_bug.cgi?id=15893 diff --git a/Makefile.am b/Makefile.am index c778487..78ae154 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,10 +27,6 @@ bin_SCRIPTS = startx xinit_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\" xinit_LDADD = $(XINIT_LIBS) -if APPLE_LEOPARD -xinit_LDFLAGS = -framework CoreServices -endif - xinit_SOURCES = \ xinit.c diff --git a/configure.ac b/configure.ac index 42c3b60..6f6bf6c 100644 --- a/configure.ac +++ b/configure.ac @@ -102,22 +102,19 @@ AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], if test "x$LAUNCHD" = "xauto"; then unset LAUNCHD - AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no]) -fi - -if test "x$LAUNCHD" = "xyes" ; then - AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available]) - case $host_os in - darwin9*|darwin1*) - AM_CONDITIONAL(APPLE_LEOPARD, true) + darwin8*) + LAUNCHD=no ;; *) - AM_CONDITIONAL(APPLE_LEOPARD, false) + AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no]) ;; esac +fi + +if test "x$LAUNCHD" = "xyes" ; then + AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available]) else - AM_CONDITIONAL(APPLE_LEOPARD,false) launchagentsdir="" launchdaemonsdir="" fi commit d315445cb85876cda56f46cb657167d4eb906ba0 Author: Jeremy Huddleston <jerem...@freedesktop.org> Date: Wed May 28 11:54:22 2008 -0700 Properly handle using xserverrc diff --git a/startx.cpp b/startx.cpp index 9266341..8ffdc70 100644 --- a/startx.cpp +++ b/startx.cpp @@ -161,12 +161,6 @@ case $1 in esac #endif -if [ -f $userserverrc ]; then - defaultserverargs=$userserverrc -elif [ -f $sysserverrc ]; then - defaultserverargs=$sysserverrc -fi - whoseargs="client" while [ x"$1" != x ]; do case "$1" in -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org