summaryrefslogtreecommitdiff
path: root/app/xinit
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2023-01-22 12:03:54 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2023-01-22 12:03:54 +0000
commit5a18f1fa1f98f028ca3609f410dcca17aa63d687 (patch)
tree6a67491a566d0ce5ab38352f630077ab69dcf5db /app/xinit
parent614eb4bbeb6c810e29d993e4c70fae2de6ab9f24 (diff)
Update xinit to version 1.4.2
Diffstat (limited to 'app/xinit')
-rw-r--r--app/xinit/ChangeLog180
-rw-r--r--app/xinit/Makefile.in6
-rw-r--r--app/xinit/README.md2
-rw-r--r--app/xinit/compile17
-rw-r--r--app/xinit/config.h.in6
-rw-r--r--app/xinit/configure157
-rw-r--r--app/xinit/configure.ac21
-rw-r--r--app/xinit/launchd/Makefile.am8
-rw-r--r--app/xinit/launchd/Makefile.in4
-rw-r--r--app/xinit/launchd/console_redirect.c418
-rw-r--r--app/xinit/launchd/console_redirect.h44
-rw-r--r--app/xinit/launchd/privileged_startx/20-font_cache.cpp6
-rw-r--r--app/xinit/launchd/privileged_startx/Makefile.am5
-rw-r--r--app/xinit/launchd/privileged_startx/Makefile.in30
-rw-r--r--app/xinit/launchd/privileged_startx/privileged_startx.plist.cpp9
-rw-r--r--app/xinit/launchd/privileged_startx/server.c8
-rw-r--r--app/xinit/launchd/user_startx/Makefile.am1
-rw-r--r--app/xinit/launchd/user_startx/Makefile.in23
-rw-r--r--app/xinit/launchd/user_startx/launchd_startx.c11
-rw-r--r--app/xinit/man/startx.man42
-rw-r--r--app/xinit/man/xinit.man2
-rw-r--r--app/xinit/startx.cpp43
-rw-r--r--app/xinit/xinit.c2
23 files changed, 275 insertions, 770 deletions
diff --git a/app/xinit/ChangeLog b/app/xinit/ChangeLog
index c67c45efb..2884cffd2 100644
--- a/app/xinit/ChangeLog
+++ b/app/xinit/ChangeLog
@@ -1,3 +1,177 @@
+commit f9786fb5a7e526035699f3d4d6661468ab20e689
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Sat Dec 3 14:05:44 2022 -0800
+
+ xinit 1.4.2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4f22f255e58fda758fcdd85f8554c4ef274600e8
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Wed Nov 9 12:22:19 2022 -0800
+
+ man page: Update remote display example from rsh to ssh
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4e66c0bf2b5751e113ad3aba79891608f7e883e2
+Author: Tim Egenton <tegenton@splattim.me>
+Date: Tue Dec 7 09:15:18 2021 -0500
+
+ startx: Source XINITRC and XSERVERRC variables
+
+ Fix issue #14
+
+ Check XINITRC and XSERVERRC, if those files do not exist then just use
+ ~/.xinitrc and ~/.xserverc as normal.
+
+ Signed-off-by: Tim Egenton <tegenton@splattim.me>
+
+commit 0ea1ec1ed445235cdba9e54e71023d5a82feed6b
+Author: Arthur Williams <taaparthur@disroot.org>
+Date: Fri Oct 14 20:59:54 2022 -0700
+
+ Don't wait for X to finish starting if it has died
+
+ On my setup, when X first starts there aren't any screens available so
+ it immediately dies. Half a second later, screens become available but
+ xinit would still be waiting for the dead X process to signal that it
+ is ready. It'll take 15s for it to timeout and respawn X.
+
+ This patch makes xinit listen for its child's death and if X dies, it'll
+ immediately stop waiting for it to finish starting and attempt to start
+ it again.
+
+commit 60389ce90f552d9dfef8facf0efaf48efa59d93c
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 28 17:30:21 2022 -0700
+
+ gitlab CI: stop requiring Signed-off-by in commits
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit d190145b94d00efe8a52c01c1675c308baa335cc
+Author: Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
+Date: Thu Jun 9 11:21:17 2022 +0200
+
+ stop unsetting DBUS_SESSION_BUS_ADDRESS variable
+
+ It's not necessary as we no longer support running startx from an
+ existing X session.
+
+ Fixes #9.
+
+ Signed-off-by: Dominik Mierzejewski <dominik@greysector.net>
+
+commit 6bdce31401e3caf10242f1e8a4855b2c8e90ea13
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Sun Jun 19 20:09:55 2022 -0700
+
+ darwin: Wait for font_cache to complete to avoid a race with `xset fb=`
+
+ Partially fixes: https://github.com/XQuartz/XQuartz/issues/216
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit bf1d55c1aeef4d4755e1dbaf05cd625e48780bfb
+Author: nia <nia@NetBSD.org>
+Date: Thu Apr 7 22:33:28 2022 +0200
+
+ startx: don't attempt to catch SIGKILL
+
+ Most shells ignore attempts to catch SIGKILL. Some, such as NetBSD's
+ /bin/sh, print an annoying message helpfully reminding you
+ that it isn't possible to catch SIGKILL whenever X starts.
+
+ Signed-off-by: Nia Alarie <nia@NetBSD.org>
+
+commit 71a8997cad602ef0adc9fed110e8a04d2a8fc8dc
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Mon Dec 6 14:37:17 2021 -0800
+
+ Build xz tarballs instead of bzip2
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 366a03498d51958757cf03aa1ebbdf06db4eb2de
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Mon Dec 6 14:37:14 2021 -0800
+
+ gitlab CI: add a basic build test
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit bdf2af54a800470990a66d11b14589e19fa568ac
+Author: Arthur Williams <taaparthur@gmail.com>
+Date: Fri Jun 4 21:44:03 2021 -0700
+
+ Remove non-portable grep usage from startx
+
+ startx uses non-portable grep flags (-o). grep isn't even needed for
+ this and has been replaced with substring removal.
+
+ Closes #6
+
+commit ae77976adaae9948e3e8d7a673dc88df4e31de46
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Mon Mar 15 17:37:53 2021 -0700
+
+ darwin: Specify +extension GLX when the user requests IGLX support
+
+ Fixes: https://github.com/XQuartz/XQuartz/issues/54
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit 8caf10c018d77a097015798b604be8817f526274
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Wed Mar 10 13:50:09 2021 -0800
+
+ darwin: Ensure we launch the user startx from $HOME
+
+ Fixes: https://github.com/XQuartz/XQuartz/issues/114
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit db21df4054e3351d14eb7dc1c3216cd23a61cee4
+Author: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Wed Mar 10 13:46:23 2021 -0800
+
+ darwin: Drop support for macOS 10.7 and earlier
+
+ Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+
+commit e2430bcb8327682340d985f89ad5137efa2f0d4f
+Author: Rickie Schroeder <1187-Gregg16@users.noreply.gitlab.freedesktop.org>
+Date: Fri Aug 28 13:34:05 2020 +0000
+
+ startx: use uname -n instead of hostname
+
+ startx calls hostname to obtain the hostname, but this is not defined by POSIX, so not guaranteed to work. The script already does some checks to deal with different hostname implementations on Linux.
+
+ Using uname -n instead fixes this in a portable way.
+
+commit 91d2aba6364ec6685411595ccafea69fe9d20d6c
+Author: Alan Coopersmith <alan.coopersmith@oracle.com>
+Date: Thu Jul 23 09:26:21 2020 -0700
+
+ Fix spelling/wording issues
+
+ Found by using:
+ codespell --builtin clear,rare,usage,informal,code,names
+
+ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+
+commit 4f54d1843a780a71c3be0b56fe2ad2ddfcbaf928
+Author: Matt Turner <mattst88@gmail.com>
+Date: Sun Mar 8 15:16:36 2020 -0700
+
+ man: Restore non-SCO UNIX bits of the man page
+
+ It looks to me like commit 5268936259c5 (Remove SCO support for
+ SHELL_CMD and startx man page.) removed the wrong bits of the man page.
+
+ This commit replaces the SCO UNIX bits of the man page with the non-SCO
+ UNIX bits.
+
+ Signed-off-by: Matt Turner <mattst88@gmail.com>
+
commit 9a8b937bcfd84575e13039f316cbcb14c9729df4
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Mar 3 11:56:43 2019 -0800
@@ -1297,7 +1471,7 @@ Date: Thu Oct 22 12:34:15 2009 -0400
when the structure of the component changes. Do not edit defaults.
commit d243b9943879ec2790d65785805aefdfbb64a378
-Author: Rémi Cardona <remi@gentoo.org>
+Author: Rémi Cardona <remi@gentoo.org>
Date: Sat Nov 14 14:51:59 2009 +0100
xinit 1.2.0
@@ -1343,7 +1517,7 @@ Date: Fri Oct 16 20:27:17 2009 -0700
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
commit c2a5751175b11d3206805468aae1ddecd02c4a98
-Author: Rémi Cardona <remi@gentoo.org>
+Author: Rémi Cardona <remi@gentoo.org>
Date: Sat Oct 3 11:50:12 2009 +0200
make XINITDIR configurable at build-time, default is unchanged
@@ -2327,7 +2501,7 @@ Date: Sat Jul 16 23:29:38 2005 +0000
correctly
commit d731a249d0c1c7f9eb77828c0d6e79cfdaf75589
-Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
+Author: Søren Sandmann Pedersen <sandmann@daimi.au.dk>
Date: Tue Jul 5 21:12:01 2005 +0000
Build system for xinit
diff --git a/app/xinit/Makefile.in b/app/xinit/Makefile.in
index 52b6abb27..a6e682d90 100644
--- a/app/xinit/Makefile.in
+++ b/app/xinit/Makefile.in
@@ -220,9 +220,9 @@ am__relativize = \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
-DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
+DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.xz
GZIP_ENV = --best
-DIST_TARGETS = dist-bzip2 dist-gzip
+DIST_TARGETS = dist-xz dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -800,6 +800,7 @@ distdir: $(DISTFILES)
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir)
+
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
@@ -807,7 +808,6 @@ dist-bzip2: distdir
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
-
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
diff --git a/app/xinit/README.md b/app/xinit/README.md
index ada1a4808..d3d8128fa 100644
--- a/app/xinit/README.md
+++ b/app/xinit/README.md
@@ -10,7 +10,7 @@ Xorg mailing list:
https://lists.x.org/mailman/listinfo/xorg
-The master development code repository can be found at:
+The primary development code repository can be found at:
https://gitlab.freedesktop.org/xorg/app/xinit
diff --git a/app/xinit/compile b/app/xinit/compile
index a85b723c7..df363c8fb 100644
--- a/app/xinit/compile
+++ b/app/xinit/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
@@ -255,7 +255,8 @@ EOF
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
@@ -339,9 +340,9 @@ exit $ret
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/app/xinit/config.h.in b/app/xinit/config.h.in
index 4174f1a2c..6a875a1fe 100644
--- a/app/xinit/config.h.in
+++ b/app/xinit/config.h.in
@@ -6,12 +6,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
-/* launchd support available */
-#undef HAVE_LAUNCHD
-
-/* Define to 1 if you have the libdispatch (GCD) available */
-#undef HAVE_LIBDISPATCH
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff --git a/app/xinit/configure b/app/xinit/configure
index 62b8c2ee5..bfc82a01b 100644
--- a/app/xinit/configure
+++ b/app/xinit/configure
@@ -1,8 +1,8 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xinit 1.4.1.
+# Generated by GNU Autoconf 2.69 for xinit 1.4.2.
#
-# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/issues>.
+# Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/-/issues>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -267,7 +267,7 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: https://gitlab.freedesktop.org/xorg/app/xinit/issues
+$0: https://gitlab.freedesktop.org/xorg/app/xinit/-/issues
$0: about your system, including any error possibly output
$0: before this message. Then install a modern shell, or
$0: manually run the script under such a shell if you do
@@ -581,9 +581,9 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xinit'
PACKAGE_TARNAME='xinit'
-PACKAGE_VERSION='1.4.1'
-PACKAGE_STRING='xinit 1.4.1'
-PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xinit/issues'
+PACKAGE_VERSION='1.4.2'
+PACKAGE_STRING='xinit 1.4.2'
+PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/app/xinit/-/issues'
PACKAGE_URL=''
ac_unique_file="Makefile.am"
@@ -649,8 +649,6 @@ XINIT_LIBS
XINIT_CFLAGS
LAUNCHAGENT_XSERVER_FALSE
LAUNCHAGENT_XSERVER_TRUE
-TIGER_LAUNCHD_FALSE
-TIGER_LAUNCHD_TRUE
LAUNCHD_FALSE
LAUNCHD_TRUE
launchagentxserver
@@ -1371,7 +1369,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xinit 1.4.1 to adapt to many kinds of systems.
+\`configure' configures xinit 1.4.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1442,7 +1440,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xinit 1.4.1:";;
+ short | recursive ) echo "Configuration of xinit 1.4.2:";;
esac
cat <<\_ACEOF
@@ -1520,7 +1518,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/issues>.
+Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/-/issues>.
_ACEOF
ac_status=$?
fi
@@ -1583,7 +1581,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xinit configure 1.4.1
+xinit configure 1.4.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1836,78 +1834,11 @@ fi
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xinit $as_me 1.4.1, which was
+It was created by xinit $as_me 1.4.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2736,7 +2667,7 @@ fi
# Define the identity of the package.
PACKAGE='xinit'
- VERSION='1.4.1'
+ VERSION='1.4.2'
cat >>confdefs.h <<_ACEOF
@@ -2783,29 +2714,6 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
# Require X.Org macros 1.19 or later for TRADITIONALCPPFLAGS
@@ -10886,25 +10794,6 @@ fi
fi
-TIGER_LAUNCHD=no
-if test "x$LAUNCHD" = "xyes" ; then
-
-$as_echo "#define HAVE_LAUNCHD 1" >>confdefs.h
-
- case $host_os in
- darwin8*)
- TIGER_LAUNCHD=yes
- ;;
- esac
- ac_fn_c_check_func "$LINENO" "dispatch_async" "ac_cv_func_dispatch_async"
-if test "x$ac_cv_func_dispatch_async" = xyes; then :
-
-$as_echo "#define HAVE_LIBDISPATCH 1" >>confdefs.h
-
-fi
-
-fi
-
cat >>confdefs.h <<_ACEOF
#define BUNDLE_ID_PREFIX "$bundleidprefix"
@@ -10922,14 +10811,6 @@ else
LAUNCHD_FALSE=
fi
- if test "x$TIGER_LAUNCHD" = "xyes"; then
- TIGER_LAUNCHD_TRUE=
- TIGER_LAUNCHD_FALSE='#'
-else
- TIGER_LAUNCHD_TRUE='#'
- TIGER_LAUNCHD_FALSE=
-fi
-
if test "x$launchagentxserver" != "xno"; then
LAUNCHAGENT_XSERVER_TRUE=
LAUNCHAGENT_XSERVER_FALSE='#'
@@ -11320,10 +11201,6 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -11336,10 +11213,6 @@ if test -z "${LAUNCHD_TRUE}" && test -z "${LAUNCHD_FALSE}"; then
as_fn_error $? "conditional \"LAUNCHD\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
-if test -z "${TIGER_LAUNCHD_TRUE}" && test -z "${TIGER_LAUNCHD_FALSE}"; then
- as_fn_error $? "conditional \"TIGER_LAUNCHD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
if test -z "${LAUNCHAGENT_XSERVER_TRUE}" && test -z "${LAUNCHAGENT_XSERVER_FALSE}"; then
as_fn_error $? "conditional \"LAUNCHAGENT_XSERVER\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -11741,7 +11614,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xinit $as_me 1.4.1, which was
+This file was extended by xinit $as_me 1.4.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -11801,13 +11674,13 @@ $config_headers
Configuration commands:
$config_commands
-Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/issues>."
+Report bugs to <https://gitlab.freedesktop.org/xorg/app/xinit/-/issues>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xinit config.status 1.4.1
+xinit config.status 1.4.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/app/xinit/configure.ac b/app/xinit/configure.ac
index 3215aaaed..32bc74830 100644
--- a/app/xinit/configure.ac
+++ b/app/xinit/configure.ac
@@ -22,14 +22,13 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf
AC_PREREQ([2.60])
-AC_INIT([xinit], [1.4.1],
- [https://gitlab.freedesktop.org/xorg/app/xinit/issues], [xinit])
+AC_INIT([xinit], [1.4.2],
+ [https://gitlab.freedesktop.org/xorg/app/xinit/-/issues], [xinit])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
-AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
+AM_INIT_AUTOMAKE([foreign dist-xz])
# Require X.Org macros 1.19 or later for TRADITIONALCPPFLAGS
m4_ifndef([XORG_MACROS_VERSION],
@@ -130,26 +129,12 @@ if test "x$LAUNCHD" = "xauto"; then
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no], [$PATH$PATH_SEPARATOR/sbin])
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
- AC_CHECK_FUNC(dispatch_async,
- AC_DEFINE([HAVE_LIBDISPATCH], 1, [Define to 1 if you have the libdispatch (GCD) available]),
- [])
-fi
-
AC_DEFINE_UNQUOTED(BUNDLE_ID_PREFIX, "$bundleidprefix", [Prefix to use for launchd identifiers])
AC_SUBST([launchagentsdir])
AC_SUBST([launchdaemonsdir])
AC_SUBST([bundleidprefix])
AC_SUBST([launchagentxserver])
AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
-AM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"])
AM_CONDITIONAL(LAUNCHAGENT_XSERVER, [test "x$launchagentxserver" != "xno"])
# Checks for pkg-config packages
diff --git a/app/xinit/launchd/Makefile.am b/app/xinit/launchd/Makefile.am
index 0135b7fcf..23ca02a69 100644
--- a/app/xinit/launchd/Makefile.am
+++ b/app/xinit/launchd/Makefile.am
@@ -1,8 +1,2 @@
DIST_SUBDIRS = privileged_startx user_startx
-SUBDIRS = privileged_startx
-
-if !TIGER_LAUNCHD
-SUBDIRS += user_startx
-endif
-
-EXTRA_DIST = console_redirect.h
+SUBDIRS = privileged_startx user_startx
diff --git a/app/xinit/launchd/Makefile.in b/app/xinit/launchd/Makefile.in
index 89028d217..90c1e9f4c 100644
--- a/app/xinit/launchd/Makefile.in
+++ b/app/xinit/launchd/Makefile.in
@@ -49,7 +49,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-@TIGER_LAUNCHD_FALSE@am__append_1 = user_startx
subdir = launchd
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -268,8 +267,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DIST_SUBDIRS = privileged_startx user_startx
-SUBDIRS = privileged_startx $(am__append_1)
-EXTRA_DIST = console_redirect.h
+SUBDIRS = privileged_startx user_startx
all: all-recursive
.SUFFIXES:
diff --git a/app/xinit/launchd/console_redirect.c b/app/xinit/launchd/console_redirect.c
deleted file mode 100644
index 7ce3626f0..000000000
--- a/app/xinit/launchd/console_redirect.c
+++ /dev/null
@@ -1,418 +0,0 @@
-/* Copyright (c) 2011 Apple Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above
- * copyright holders shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without
- * prior written authorization.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#else
-#define DEBUG_CONSOLE_REDIRECT 1
-#define HAVE_LIBDISPATCH 1
-#endif
-
-#include <assert.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/event.h>
-#include <asl.h>
-#include <errno.h>
-#include <fcntl.h>
-
-#include "console_redirect.h"
-
-#define BUF_SIZE 512
-
-#ifdef HAVE_LIBDISPATCH
-#include <dispatch/dispatch.h>
-
-static dispatch_queue_t redirect_serial_q;
-static dispatch_group_t read_source_group;
-#else
-#include <pthread.h>
-
-static pthread_t redirect_pthread;
-static pthread_mutex_t redirect_fds_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static int kq;
-
-/* Notifications to our reader thread */
-#define ASL_REDIRECT_TERMINATE ((void *)(uintptr_t)1)
-#endif
-
-typedef struct {
- int level;
- aslclient asl;
- aslmsg msg;
-
- /* Buffered reading */
- char *buf;
- char *w;
-
-#ifdef HAVE_LIBDISPATCH
- dispatch_source_t read_source;
-#endif
-} asl_redirect;
-
-static asl_redirect *redirect_fds = NULL;
-static int n_redirect_fds = 0;
-
-/* Read from the FD until there is no more to read and redirect to ASL.
- * Preconditions:
- * 1: pthread_mutex_lock lock is held (pthreads) or called
- * from the appropriate serial queue for operating on
- * redirect_fds
- * 2: fd corresponds to a valid entry in redirect_fds
- *
- * Return values:
- * If the pipe is closed, EOF is returned regardless of how many bytes
- * were processed. If the pipe is still open, the number of read bytes
- * is returned.
- */
-static inline int _read_redirect(int fd, int flush) {
- int total_read = 0;
- int nbytes;
- asl_redirect *aslr = &redirect_fds[fd];
-
- while((nbytes = read(fd, aslr->w, BUF_SIZE - (aslr->w - aslr->buf) - 1)) > 0) {
- char *s, *p;
-
- /* Increment our returned number read */
- total_read += nbytes;
-
- nbytes += (aslr->w - aslr->buf);
- aslr->buf[nbytes] = '\0';
-
- /* One line at a time */
- for(p=aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) {
- // Find null or \n
- for(s=p; *s && *s != '\n'; s++);
- if(*s == '\n') {
- *s='\0';
- asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p);
- } else if(aslr->buf != p) {
- memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf));
- aslr->w = aslr->buf + (s - p);
- break;
- } else if(nbytes == BUF_SIZE - 1) {
- asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p);
- aslr->w = aslr->buf;
- break;
- }
- }
- }
-
- /* Flush if requested or we're at EOF */
- if(flush || nbytes == 0) {
- if(aslr->w > aslr->buf) {
- *aslr->w = '\0';
- asl_log(aslr->asl, aslr->msg, aslr->level, "%s", aslr->buf);
- }
- }
-
- if(nbytes == 0)
- return EOF;
- return total_read;
-}
-
-#ifdef HAVE_LIBDISPATCH
-static void read_from_source(void *_source) {
- dispatch_source_t source = (dispatch_source_t)_source;
- int fd = dispatch_source_get_handle(source);
- if(_read_redirect(fd, 0) == EOF) {
- dispatch_source_cancel(source);
- }
-}
-
-static void cancel_source(void *_source) {
- dispatch_source_t source = (dispatch_source_t)_source;
- int fd = dispatch_source_get_handle(source);
- asl_redirect *aslr = &redirect_fds[fd];
-
- /* Flush the buffer */
- _read_redirect(fd, 1);
-
- close(fd);
- free(aslr->buf);
- memset(aslr, 0, sizeof(*aslr));
- dispatch_release(source);
- dispatch_group_leave(read_source_group);
-}
-
-#else /* !HAVE_LIBDISPATCH */
-static void *redirect_thread(void *ctx __unused) {
- struct kevent ev;
- int n;
-
- while(1) {
- n = kevent(kq, NULL, 0, &ev, 1, NULL);
-
- /* Bail on errors */
- if(n < 0) {
- asl_log(NULL, NULL, ASL_LEVEL_ERR, "kevent failure: %s", strerror(errno));
- break;
- }
-
- /* This should not happen */
- if(n == 0)
- continue;
-
- switch(ev.filter) {
- case EVFILT_READ:
- pthread_mutex_lock(&redirect_fds_lock);
- {
- int fd = ev.ident;
- int close_fd = 0;
- asl_redirect *aslr = &redirect_fds[fd];
-
- if(fd < 0 || fd >= n_redirect_fds || aslr->buf == NULL) {
- asl_log(NULL, NULL, ASL_LEVEL_ERR, "Unexpected file descriptor: %d", fd);
- goto next;
- }
-
- if(ev.flags & EV_EOF) {
- close_fd = 1;
- if(EOF != _read_redirect(fd, 1)) {
- asl_log(NULL, NULL, ASL_LEVEL_ERR, "kevent reported EOF on %d, but read doesn't concur.", fd);
- }
- } else {
- close_fd = (EOF == _read_redirect(fd, 0));
- }
-
- if(close_fd) {
- EV_SET(&ev, fd, EVFILT_READ, EV_DELETE, 0, 0, 0);
- kevent(kq, &ev, 1, NULL, 0, NULL);
- close(fd);
- free(aslr->buf);
- memset(aslr, 0, sizeof(*aslr));
- }
- }
- next:
- pthread_mutex_unlock(&redirect_fds_lock);
-
- case EVFILT_TIMER:
- if(ev.udata == ASL_REDIRECT_TERMINATE)
- return NULL;
-
- default:
- ;;
- }
- }
-
- return NULL;
-}
-#endif
-
-static void redirect_atexit(void) {
- /* stdout is linebuffered, so flush the buffer */
- if(redirect_fds[STDOUT_FILENO].buf)
- fflush(stdout);
-
-#ifdef HAVE_LIBDISPATCH
- {
- int i;
-
- /* Cancel all of our dispatch sources, so they flush to ASL */
- for(i=0; i < n_redirect_fds; i++)
- if(redirect_fds[i].read_source)
- dispatch_source_cancel(redirect_fds[i].read_source);
-
- /* Wait at least three seconds for our sources to flush to ASL */
- dispatch_group_wait(read_source_group, dispatch_time(DISPATCH_TIME_NOW, 3LL * NSEC_PER_SEC));
- }
-#else
- {
- struct kevent ev;
-
- /* Tell our reader thread it is time to pack up and go home */
- EV_SET(&ev, 0, EVFILT_TIMER, EV_ADD | EV_ONESHOT, 0, 0, ASL_REDIRECT_TERMINATE);
- kevent(kq, &ev, 1, NULL, 0, NULL);
-
- pthread_join(redirect_pthread, NULL);
- }
-#endif
-}
-
-#ifdef HAVE_LIBDISPATCH
-static void xi_asl_init(void *ctx __unused)
-#else
-static void xi_asl_init(void)
-#endif
-{
- assert((redirect_fds = calloc(16, sizeof(*redirect_fds))) != NULL);
- n_redirect_fds = 16;
-
-#ifdef HAVE_LIBDISPATCH
- redirect_serial_q = dispatch_queue_create("com.apple.asl-redirect", NULL);
- assert(redirect_serial_q != NULL);
-
- read_source_group = dispatch_group_create();
- assert(read_source_group != NULL);
-#else
- assert((kq = kqueue()) != -1);
- assert(pthread_create(&redirect_pthread, NULL, redirect_thread, NULL) == 0);
-#endif
-
- atexit(redirect_atexit);
-}
-
-int xi_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) {
-#ifdef HAVE_LIBDISPATCH
- int err __block = 0;
- static dispatch_once_t once_control;
- dispatch_once_f(&once_control, NULL, xi_asl_init);
-#else
- int err = 0;
- static pthread_once_t once_control = PTHREAD_ONCE_INIT;
- assert(pthread_once(&once_control, xi_asl_init) == 0);
-#endif
-
- if(fd < 0)
- return EBADF;
-
-#ifdef HAVE_LIBDISPATCH
-#define BLOCK_DONE return
- dispatch_sync(redirect_serial_q, ^
-#else
-#define BLOCK_DONE goto done
- assert(pthread_mutex_lock(&redirect_fds_lock) == 0);
-#endif
- {
- /* Reallocate if we need more space */
- if(fd >= n_redirect_fds) {
- size_t new_n = 1 << (ffs(fd) + 1);
- asl_redirect *new_array = realloc(redirect_fds, new_n * sizeof(*redirect_fds));
- if(!new_array) {
- err = errno;
- BLOCK_DONE;
- }
- redirect_fds = new_array;
- memset(redirect_fds + n_redirect_fds, 0, new_n - n_redirect_fds);
- n_redirect_fds = new_n;
- }
-
- /* If we're already listening on it, return error. */
- if(redirect_fds[fd].buf != NULL) {
- err = EBADF;
- BLOCK_DONE;
- }
-
- /* Initialize our buffer */
- redirect_fds[fd].buf = (char *)malloc(BUF_SIZE);
- if(redirect_fds[fd].buf == NULL) {
- err = errno;
- BLOCK_DONE;
- }
- redirect_fds[fd].w = redirect_fds[fd].buf;
-
- /* Store our ASL settings */
- redirect_fds[fd].level = level;
- redirect_fds[fd].asl = asl;
- redirect_fds[fd].msg = msg;
-
- /* Don't block on reads from this fd */
- fcntl(fd, F_SETFL, O_NONBLOCK);
-
- /* Start listening */
-#ifdef HAVE_LIBDISPATCH
- {
- dispatch_source_t read_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, redirect_serial_q);
- redirect_fds[fd].read_source = read_source;
- dispatch_set_context(read_source, read_source);
- dispatch_source_set_event_handler_f(read_source, read_from_source);
- dispatch_source_set_cancel_handler_f(read_source, cancel_source);
- dispatch_group_enter(read_source_group);
- dispatch_resume(read_source);
- }
-#else
- {
- struct kevent ev;
- EV_SET(&ev, fd, EVFILT_READ, EV_ADD, 0, 0, 0);
- kevent(kq, &ev, 1, NULL, 0, NULL);
- }
-#endif
- }
-#ifdef HAVE_LIBDISPATCH
- );
-#else
-done:
- assert(pthread_mutex_unlock(&redirect_fds_lock) == 0);
-#endif
-#undef BLOCK_DONE
-
- return err;
-}
-
-int xi_asl_capture_fd(aslclient asl, aslmsg msg, int level, int fd) {
- int pipepair[2];
-
- /* Create pipe */
- if(pipe(pipepair) == -1)
- return errno;
-
- /* Close the read fd but not the write fd on exec */
- if(fcntl(pipepair[0], F_SETFD, FD_CLOEXEC) == -1)
- return errno;
-
- /* Replace the existing fd */
- if(dup2(pipepair[1], fd) == -1) {
- close(pipepair[0]);
- close(pipepair[1]);
- return errno;
- }
-
- /* If we capture STDOUT_FILENO, make sure we linebuffer stdout */
- if(fd == STDOUT_FILENO)
- setlinebuf(stdout);
-
- /* Close the duplicate fds since they've been reassigned */
- close(pipepair[1]);
-
- /* Hand off the read end of our pipe to xi_asl_log_fd */
- return xi_asl_log_fd(asl, msg, level, pipepair[0]);
-}
-
-#ifdef DEBUG_CONSOLE_REDIRECT
-int main(int argc __unused, char **argv __unused) {
- xi_asl_capture_fd(NULL, NULL, ASL_LEVEL_NOTICE, STDOUT_FILENO);
- xi_asl_capture_fd(NULL, NULL, ASL_LEVEL_ERR, STDERR_FILENO);
-
- fprintf(stderr, "TEST ERR1\n");
- fprintf(stdout, "TEST OUT1\n");
- fprintf(stderr, "TEST ERR2\n");
- fprintf(stdout, "TEST OUT2\n");
- system("/bin/echo SYST OUT");
- system("/bin/echo SYST ERR >&2");
- fprintf(stdout, "TEST OUT3\n");
- fprintf(stdout, "TEST OUT4\n");
- fprintf(stderr, "TEST ERR3\n");
- fprintf(stderr, "TEST ERR4\n");
-
- exit(0);
-}
-#endif
diff --git a/app/xinit/launchd/console_redirect.h b/app/xinit/launchd/console_redirect.h
deleted file mode 100644
index 134def655..000000000
--- a/app/xinit/launchd/console_redirect.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (c) 2011 Apple Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation files
- * (the "Software"), to deal in the Software without restriction,
- * including without limitation the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
- * HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name(s) of the above
- * copyright holders shall not be used in advertising or otherwise to
- * promote the sale, use or other dealings in this Software without
- * prior written authorization.
- */
-
-#ifndef _XQUARTZ_CONSOLE_REDIRECT_H_
-#define _XQUARTZ_CONSOLE_REDIRECT_H_
-
-#include <asl.h>
-
-/* The given fd is replaced with a pipe. Anything written to it will will be
- * logged to ASL.
- */
-int xi_asl_capture_fd(aslclient asl, aslmsg msg, int level, int fd);
-
-/* The given fd is read from and passed along to ASL until all write ends of the
- * pipe are closed. Once the last writer has closed the pipe, we close our end.
- */
-int xi_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd);
-
-#endif
diff --git a/app/xinit/launchd/privileged_startx/20-font_cache.cpp b/app/xinit/launchd/privileged_startx/20-font_cache.cpp
index 6d43e107b..1048b153d 100644
--- a/app/xinit/launchd/privileged_startx/20-font_cache.cpp
+++ b/app/xinit/launchd/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 -s &
+ BINDIR/font_cache -s
elif [ -x BINDIR/font_cache.sh ] ; then
- BINDIR/font_cache.sh -s &
+ BINDIR/font_cache.sh -s
elif [ -x BINDIR/fc-cache ] ; then
- BINDIR/fc-cache &
+ BINDIR/fc-cache
fi
diff --git a/app/xinit/launchd/privileged_startx/Makefile.am b/app/xinit/launchd/privileged_startx/Makefile.am
index a6ed4929b..ea9900545 100644
--- a/app/xinit/launchd/privileged_startx/Makefile.am
+++ b/app/xinit/launchd/privileged_startx/Makefile.am
@@ -36,12 +36,7 @@ privstartx_SCRIPTS = 10-tmpdirs 20-font_cache
AM_CPPFLAGS = -I$(srcdir)/.. -DXINITDIR=\"$(xinitrcdir)\" -DSCRIPTDIR=\"$(privstartxdir)\" -DBINDIR=\"$(bindir)\"
CPP_FILES_FLAGS = -D__libexecdir__="$(libexecdir)" -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)" -DBUNDLE_ID_PREFIX="$(bundleidprefix)"
-if TIGER_LAUNCHD
-CPP_FILES_FLAGS += -DTIGER_LAUNCHD
-endif
-
dist_privileged_startx_SOURCES = \
- $(srcdir)/../console_redirect.c \
server.c \
client.c \
privileged_startx.c
diff --git a/app/xinit/launchd/privileged_startx/Makefile.in b/app/xinit/launchd/privileged_startx/Makefile.in
index 015eb3e86..02aa64d01 100644
--- a/app/xinit/launchd/privileged_startx/Makefile.in
+++ b/app/xinit/launchd/privileged_startx/Makefile.in
@@ -89,7 +89,6 @@ host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/cpprules.in $(top_srcdir)/depcomp
libexec_PROGRAMS = privileged_startx$(EXEEXT)
-@TIGER_LAUNCHD_TRUE@am__append_1 = -DTIGER_LAUNCHD
subdir = launchd/privileged_startx
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -102,8 +101,8 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(libexecdir)" \
"$(DESTDIR)$(privstartxdir)" "$(DESTDIR)$(launchdaemonsdir)"
PROGRAMS = $(libexec_PROGRAMS)
-dist_privileged_startx_OBJECTS = console_redirect.$(OBJEXT) \
- server.$(OBJEXT) client.$(OBJEXT) privileged_startx.$(OBJEXT)
+dist_privileged_startx_OBJECTS = server.$(OBJEXT) client.$(OBJEXT) \
+ privileged_startx.$(OBJEXT)
nodist_privileged_startx_OBJECTS = privileged_startxServer.$(OBJEXT) \
privileged_startxUser.$(OBJEXT)
privileged_startx_OBJECTS = $(dist_privileged_startx_OBJECTS) \
@@ -153,10 +152,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
@@ -341,12 +336,8 @@ xinitrcdir = $(XINITDIR)
privstartxdir = $(xinitrcdir)/privileged_startx.d
privstartx_SCRIPTS = 10-tmpdirs 20-font_cache
AM_CPPFLAGS = -I$(srcdir)/.. -DXINITDIR=\"$(xinitrcdir)\" -DSCRIPTDIR=\"$(privstartxdir)\" -DBINDIR=\"$(bindir)\"
-CPP_FILES_FLAGS = -D__libexecdir__="$(libexecdir)" \
- -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" \
- -DBINDIR="$(bindir)" -DBUNDLE_ID_PREFIX="$(bundleidprefix)" \
- $(am__append_1)
+CPP_FILES_FLAGS = -D__libexecdir__="$(libexecdir)" -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)" -DBUNDLE_ID_PREFIX="$(bundleidprefix)"
dist_privileged_startx_SOURCES = \
- $(srcdir)/../console_redirect.c \
server.c \
client.c \
privileged_startx.c
@@ -498,7 +489,6 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console_redirect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privileged_startx.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privileged_startxServer.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/privileged_startxUser.Po@am__quote@
@@ -517,20 +507,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-console_redirect.o: $(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT console_redirect.o -MD -MP -MF $(DEPDIR)/console_redirect.Tpo -c -o console_redirect.o `test -f '$(srcdir)/../console_redirect.c' || echo '$(srcdir)/'`$(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/console_redirect.Tpo $(DEPDIR)/console_redirect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../console_redirect.c' object='console_redirect.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o console_redirect.o `test -f '$(srcdir)/../console_redirect.c' || echo '$(srcdir)/'`$(srcdir)/../console_redirect.c
-
-console_redirect.obj: $(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT console_redirect.obj -MD -MP -MF $(DEPDIR)/console_redirect.Tpo -c -o console_redirect.obj `if test -f '$(srcdir)/../console_redirect.c'; then $(CYGPATH_W) '$(srcdir)/../console_redirect.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../console_redirect.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/console_redirect.Tpo $(DEPDIR)/console_redirect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../console_redirect.c' object='console_redirect.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o console_redirect.obj `if test -f '$(srcdir)/../console_redirect.c'; then $(CYGPATH_W) '$(srcdir)/../console_redirect.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../console_redirect.c'; fi`
install-launchdaemonsDATA: $(launchdaemons_DATA)
@$(NORMAL_INSTALL)
@list='$(launchdaemons_DATA)'; test -n "$(launchdaemonsdir)" || list=; \
diff --git a/app/xinit/launchd/privileged_startx/privileged_startx.plist.cpp b/app/xinit/launchd/privileged_startx/privileged_startx.plist.cpp
index e1652b037..370350a16 100644
--- a/app/xinit/launchd/privileged_startx/privileged_startx.plist.cpp
+++ b/app/xinit/launchd/privileged_startx/privileged_startx.plist.cpp
@@ -10,14 +10,6 @@
<string>-d</string>
<string>SCRIPTDIR</string>
</array>
-#ifdef TIGER_LAUNCHD
- <key>RunAtLoad</key>
- <true/>
- <key>KeepAlive</key>
- <true/>
- <key>ServiceIPC</key>
- <true/>
-#else
<key>MachServices</key>
<dict>
<key>BUNDLE_ID_PREFIX.privileged_startx</key>
@@ -27,6 +19,5 @@
<integer>120</integer>
<key>EnableTransactions</key>
<true/>
-#endif
</dict>
</plist>
diff --git a/app/xinit/launchd/privileged_startx/server.c b/app/xinit/launchd/privileged_startx/server.c
index a93cae3bc..f37c9b195 100644
--- a/app/xinit/launchd/privileged_startx/server.c
+++ b/app/xinit/launchd/privileged_startx/server.c
@@ -46,8 +46,6 @@
#include <asl.h>
#include <errno.h>
-#include "console_redirect.h"
-
#include "privileged_startx.h"
#include "privileged_startxServer.h"
@@ -137,7 +135,7 @@ int server_main(const char *dir) {
}
if (launch_data_get_type(config) == LAUNCH_DATA_ERRNO) {
- asl_log(NULL, NULL, ASL_LEVEL_ERR, "launchd checkin failed eith error: %d %s", launch_data_get_errno(config), strerror(launch_data_get_errno(config)));
+ asl_log(NULL, NULL, ASL_LEVEL_ERR, "launchd checkin failed with error: %d %s", launch_data_get_errno(config), strerror(launch_data_get_errno(config)));
exit(EXIT_FAILURE);
}
@@ -153,8 +151,8 @@ int server_main(const char *dir) {
}
aslc = asl_open(labelstr, 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);
#ifdef LAUNCH_JOBKEY_MACHSERVICES
launch_data_t tmv;
diff --git a/app/xinit/launchd/user_startx/Makefile.am b/app/xinit/launchd/user_startx/Makefile.am
index e895ee202..1b18db010 100644
--- a/app/xinit/launchd/user_startx/Makefile.am
+++ b/app/xinit/launchd/user_startx/Makefile.am
@@ -26,7 +26,6 @@ libexec_PROGRAMS = launchd_startx
AM_CPPFLAGS = -I$(srcdir)/.. -DXINITDIR=\"$(xinitrcdir)\" -DBINDIR=\"$(bindir)\"
dist_launchd_startx_SOURCES = \
- $(srcdir)/../console_redirect.c \
launchd_startx.c
CPP_FILES_FLAGS = \
diff --git a/app/xinit/launchd/user_startx/Makefile.in b/app/xinit/launchd/user_startx/Makefile.in
index 75dee4456..2d9102836 100644
--- a/app/xinit/launchd/user_startx/Makefile.in
+++ b/app/xinit/launchd/user_startx/Makefile.in
@@ -95,8 +95,7 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(libexecdir)" \
"$(DESTDIR)$(launchagentsdir)"
PROGRAMS = $(libexec_PROGRAMS)
-dist_launchd_startx_OBJECTS = console_redirect.$(OBJEXT) \
- launchd_startx.$(OBJEXT)
+dist_launchd_startx_OBJECTS = launchd_startx.$(OBJEXT)
launchd_startx_OBJECTS = $(dist_launchd_startx_OBJECTS)
launchd_startx_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
@@ -115,10 +114,6 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
@@ -327,7 +322,6 @@ CPP_SED_MAGIC = $(SED) -e '/^\# *[0-9][0-9]* *.*$$/d' \
SUFFIXES = .cpp
AM_CPPFLAGS = -I$(srcdir)/.. -DXINITDIR=\"$(xinitrcdir)\" -DBINDIR=\"$(bindir)\"
dist_launchd_startx_SOURCES = \
- $(srcdir)/../console_redirect.c \
launchd_startx.c
CPP_FILES_FLAGS = -D__libexecdir__="$(libexecdir)" \
@@ -425,7 +419,6 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console_redirect.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/launchd_startx.Po@am__quote@
.c.o:
@@ -441,20 +434,6 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-console_redirect.o: $(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT console_redirect.o -MD -MP -MF $(DEPDIR)/console_redirect.Tpo -c -o console_redirect.o `test -f '$(srcdir)/../console_redirect.c' || echo '$(srcdir)/'`$(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/console_redirect.Tpo $(DEPDIR)/console_redirect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../console_redirect.c' object='console_redirect.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o console_redirect.o `test -f '$(srcdir)/../console_redirect.c' || echo '$(srcdir)/'`$(srcdir)/../console_redirect.c
-
-console_redirect.obj: $(srcdir)/../console_redirect.c
-@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT console_redirect.obj -MD -MP -MF $(DEPDIR)/console_redirect.Tpo -c -o console_redirect.obj `if test -f '$(srcdir)/../console_redirect.c'; then $(CYGPATH_W) '$(srcdir)/../console_redirect.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../console_redirect.c'; fi`
-@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/console_redirect.Tpo $(DEPDIR)/console_redirect.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(srcdir)/../console_redirect.c' object='console_redirect.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o console_redirect.obj `if test -f '$(srcdir)/../console_redirect.c'; then $(CYGPATH_W) '$(srcdir)/../console_redirect.c'; else $(CYGPATH_W) '$(srcdir)/$(srcdir)/../console_redirect.c'; fi`
install-launchagentsDATA: $(launchagents_DATA)
@$(NORMAL_INSTALL)
@list='$(launchagents_DATA)'; test -n "$(launchagentsdir)" || list=; \
diff --git a/app/xinit/launchd/user_startx/launchd_startx.c b/app/xinit/launchd/user_startx/launchd_startx.c
index 67419a4b6..e2589bed5 100644
--- a/app/xinit/launchd/user_startx/launchd_startx.c
+++ b/app/xinit/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);
diff --git a/app/xinit/man/startx.man b/app/xinit/man/startx.man
index 5a48c3d07..2fe952d8b 100644
--- a/app/xinit/man/startx.man
+++ b/app/xinit/man/startx.man
@@ -71,25 +71,27 @@ startx \-\^\- \-layout Multihead
.PP
To determine the client to run,
.B startx
-looks for the following files, in order:
-.RS
-.PP
-.I $(HOME)/.startxrc
-.PP
-.I __libdir__/sys.startxrc
-.PP
-.I $(HOME)/.xinitrc
-.PP
-.I __xinitdir__/xinitrc
-.RE
-.PP
+first checks the environment variable
+.I XINITRC
+for a filename. If that variable is unset, or does not contain a filename,
+it looks for a file called
+.I .xinitrc
+in the user's home directory. If that is not found, it uses
+the file
+.I xinitrc
+in the
+.I xinit
+library directory.
If command line client options are given, they override this
behavior and revert to the
.BR xinit (__appmansuffix__)
behavior.
To determine the server to run,
.B startx
-first looks for a file called
+checks the environment variable
+.I XSERVERRC
+for a filename. If that variable is unset, or does not contain a filename,
+it looks for a file called
.I .xserverrc
in the user's home directory. If that is not found, it uses
the file
@@ -165,6 +167,20 @@ for the local host. See the
and
.IR Xsecurity (__miscmansuffix__)
manual pages for more information on X client/server authentication.
+.TP 25
+XINITRC
+This variable should contain the location of an xinitrc file. If unset,
+.I $(HOME)/.xinitrc
+or
+.I __xinitdir__/xinitrc
+will be used.
+.TP 25
+XSERVERRC
+This variable should contain the location of an xserver file. If unset,
+.I $(HOME)/.xinitrc
+or
+.I __xinitdir__/xserverrc
+will be used.
.SH FILES
.TP 25
.I $(HOME)/.xinitrc
diff --git a/app/xinit/man/xinit.man b/app/xinit/man/xinit.man
index d9d08df1d..d51fecf4e 100644
--- a/app/xinit/man/xinit.man
+++ b/app/xinit/man/xinit.man
@@ -120,7 +120,7 @@ arguments to the default \fIxterm\fP command. It will ignore \fI\.xinitrc\fP.
This will use the command \fI\./Xorg \-l \-c\fP to start the server and will
append the arguments \fI\-e widgets\fP to the default \fIxterm\fP command.
.TP 8
-.B "xinit /usr/ucb/rsh fasthost cpupig \-display ws:1 \-\^\- :1 \-a 2 \-t 5"
+.B "xinit /usr/bin/ssh \-X fasthost cpupig \-\^\- :1 \-a 2 \-t 5"
This will start a server named \fIX\fP on display 1 with the arguments
\fI\-a 2 \-t 5\fP. It will then start a remote shell on the machine
\fBfasthost\fP in which it will run the command \fIcpupig\fP, telling it
diff --git a/app/xinit/startx.cpp b/app/xinit/startx.cpp
index 3ab9a26a3..ff56efdff 100644
--- a/app/xinit/startx.cpp
+++ b/app/xinit/startx.cpp
@@ -2,16 +2,16 @@ XCOMM!SHELL_CMD
XCOMM
XCOMM This is just a sample implementation of a slightly less primitive
-XCOMM interface than xinit. It looks for user .xinitrc and .xserverrc
-XCOMM files, then system xinitrc and xserverrc files, else lets xinit choose
-XCOMM its default. The system xinitrc should probably do things like check
-XCOMM for .Xresources files and merge them in, start up a window manager,
-XCOMM and pop a clock and several xterms.
+XCOMM interface than xinit. It looks for XINITRC and XSERVERRC environment
+XCOMM variables, then user .xinitrc and .xserverrc files, and then system
+XCOMM xinitrc and xserverrc files, else lets xinit choose its default.
+XCOMM The system xinitrc should probably do things like check for
+XCOMM .Xresources files and merge them in, start up a window manager, and
+XCOMM pop a clock and several xterms.
XCOMM
XCOMM Site administrators are STRONGLY urged to write nicer versions.
XCOMM
-unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER
#ifdef __APPLE__
@@ -48,9 +48,11 @@ export PATH
#endif
userclientrc=$HOME/.xinitrc
+[ -f "${XINITRC}" ] && userclientrc="${XINITRC}"
sysclientrc=XINITDIR/xinitrc
userserverrc=$HOME/.xserverrc
+[ -f "${XSERVERRC}" ] && userclientrc="${XSERVERRC}"
sysserverrc=XINITDIR/xserverrc
defaultclient=XTERM
defaultserver=XSERVER
@@ -87,17 +89,17 @@ fi
XCOMM First, start caching fonts
if [ x`defaults read $X11_PREFS_DOMAIN cache_fonts` = x1 ] ; then
if [ -x $bindir/font_cache ] ; then
- $bindir/font_cache &
+ $bindir/font_cache
elif [ -x $bindir/font_cache.sh ] ; then
- $bindir/font_cache.sh &
+ $bindir/font_cache.sh
elif [ -x $bindir/fc-cache ] ; then
- $bindir/fc-cache &
+ $bindir/fc-cache
fi
fi
if [ -x __libexecdir__/privileged_startx ] ; then
- # Don't push this into the background becasue it can cause
- # a race to create /tmp/.X11-unix
+ XCOMM Don't push this into the background because it can cause
+ XCOMM a race to create /tmp/.X11-unix
__libexecdir__/privileged_startx
fi
@@ -114,7 +116,7 @@ else
fi
if [ x`defaults read $X11_PREFS_DOMAIN enable_iglx` = x1 ] ; then
- defaultserverargs="$defaultserverargs +iglx"
+ defaultserverargs="$defaultserverargs +iglx +extension GLX"
else
defaultserverargs="$defaultserverargs -iglx"
fi
@@ -206,7 +208,7 @@ if [ x"$server" = x ]; then
XCOMM "https://bugzilla.redhat.com/show_bug.cgi?id=806491"
tty=$(tty)
if expr "$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then
- tty_num=$(echo "$tty" | grep -oE '[0-9]+$')
+ tty_num=${tty#/dev/tty}
vtarg="vt$tty_num -keeptty"
fi
#endif
@@ -251,18 +253,7 @@ if [ x"$enable_xauth" = x1 ] ; then
removelist=
XCOMM set up default Xauth info for this machine
- case `uname` in
- Linux*)
- if [ -z "`hostname --version 2>&1 | grep GNU`" ]; then
- hostname=`hostname -f`
- else
- hostname=`hostname`
- fi
- ;;
- *)
- hostname=`hostname`
- ;;
- esac
+ hostname=`uname -n`
authdisplay=${display:-:0}
#if defined(HAS_COOKIE_MAKER) && defined(MK_COOKIE)
@@ -282,7 +273,7 @@ if [ x"$enable_xauth" = x1 ] ; then
XCOMM create a file with auth information for the server. ':0' is a dummy.
xserverauthfile=`mktemp ${HOME}/.serverauth.XXXXXXXXXX`
- trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP KILL BUS TERM
+ trap "rm -f '$xserverauthfile'" HUP INT QUIT ILL TRAP BUS TERM
xauth -q -f "$xserverauthfile" << EOF
add :$dummy . $mcookie
EOF
diff --git a/app/xinit/xinit.c b/app/xinit/xinit.c
index 06c92b2a4..19022c198 100644
--- a/app/xinit/xinit.c
+++ b/app/xinit/xinit.c
@@ -263,7 +263,6 @@ main(int argc, char *argv[])
/*
* Start the server and client.
*/
- signal(SIGCHLD, SIG_DFL); /* Insurance */
/* Let those signal interrupt the wait() call in the main loop */
memset(&sa, 0, sizeof sa);
@@ -284,6 +283,7 @@ main(int argc, char *argv[])
sigaction(SIGALRM, &si, NULL);
sigaction(SIGUSR1, &si, NULL);
+ sigaction(SIGCHLD, &si, NULL);
#ifdef __APPLE__
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060