From 335937217a51e5e159a14463e0b1e3aedf35c6be Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 19 May 2012 04:22:14 -0700 Subject: darwin: Silence a syslog message from defaults Unfortunately defaults has no way to check if a preference exists, and it prints a message to syslog if we read one that doesn't exist. dpi is one that commonly doesn't exist and results in user confusion when they read syslog. Signed-off-by: Jeremy Huddleston --- startx.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/startx.cpp b/startx.cpp index c92c51c..cd795c7 100644 --- a/startx.cpp +++ b/startx.cpp @@ -126,7 +126,9 @@ 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 2>&1 ; then +XCOMM The second check is the real one. The first is to hopefully avoid +XCOMM needless syslog spamming. +if defaults read $X11_PREFS_DOMAIN 2> /dev/null | grep -q '"dpi"' && defaults read $X11_PREFS_DOMAIN dpi > /dev/null 2>&1 ; then defaultserverargs="$defaultserverargs -dpi `defaults read $X11_PREFS_DOMAIN dpi`" fi -- cgit v1.2.3 From 641588afe92c803a1231ecf6281115f55b20e62a Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 19 May 2012 04:30:49 -0700 Subject: laucnhd: Silence some syslog spam Signed-off-by: Jeremy Huddleston --- launchd/privileged_startx/10-tmpdirs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launchd/privileged_startx/10-tmpdirs.cpp b/launchd/privileged_startx/10-tmpdirs.cpp index 7786426..6ba045f 100755 --- a/launchd/privileged_startx/10-tmpdirs.cpp +++ b/launchd/privileged_startx/10-tmpdirs.cpp @@ -41,14 +41,14 @@ STAT=/usr/bin/stat for dir in /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix ; do success=0 for attempt in 1 2 3 4 5 ; do - check=`${STAT} -f '%#p %u %g' ${dir}` + check=`${STAT} -f '%#p %u %g' ${dir} 2> /dev/null` if [ "${check}" = "041777 0 0" ] ; then success=1 break - else + elif [ -n "${check}" ] ; then saved=$(${MKTEMP} -d ${dir}-XXXXXXXX) mv ${dir} ${saved} - echo "${dir} exists but is insecure. It has been moved into ${saved}" + echo "${dir} exists but is insecure. It has been moved into ${saved}" >&2 fi # Use mktemp rather than mkdir to avoid possible security issue -- cgit v1.2.3 From 8156aad786754499f4636104aa5bd8a27a281448 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 19 May 2012 04:34:32 -0700 Subject: Annotate Fatal and Fatalx as _X_NORETURN Signed-off-by: Jeremy Huddleston --- configure.ac | 2 +- xinit.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index d18c4b0..db65b4c 100644 --- a/configure.ac +++ b/configure.ac @@ -141,7 +141,7 @@ AM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"]) AM_CONDITIONAL(LAUNCHAGENT_XSERVER, [test "x$launchagentxserver" != "xno"]) # Checks for pkg-config packages -PKG_CHECK_MODULES(XINIT, x11) +PKG_CHECK_MODULES(XINIT, x11 xproto >= 7.0.17) case $host_os in *bsd*) diff --git a/xinit.c b/xinit.c index 2ab817f..46f717a 100644 --- a/xinit.c +++ b/xinit.c @@ -653,6 +653,7 @@ verrorx(const char *fmt, va_list ap) } static void +_X_NORETURN Fatal(const char *fmt, ...) { va_list ap; @@ -663,6 +664,7 @@ Fatal(const char *fmt, ...) } static void +_X_NORETURN Fatalx(const char *fmt, ...) { va_list ap; -- cgit v1.2.3 From bfed997da5f083e3ddfbda440e114d1261d18b14 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 24 Jul 2012 08:47:29 -0700 Subject: XQuartz: Fix an issue where -dpi was not being passed to the server despite being set For some reason 'defaults' sometimes shows dpi in quotes and sometimes doesn't. Regression-from: 335937217a51e5e159a14463e0b1e3aedf35c6be Signed-off-by: Jeremy Huddleston --- startx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startx.cpp b/startx.cpp index cd795c7..c595b84 100644 --- a/startx.cpp +++ b/startx.cpp @@ -128,7 +128,7 @@ fi XCOMM The second check is the real one. The first is to hopefully avoid XCOMM needless syslog spamming. -if defaults read $X11_PREFS_DOMAIN 2> /dev/null | grep -q '"dpi"' && defaults read $X11_PREFS_DOMAIN dpi > /dev/null 2>&1 ; then +if defaults read $X11_PREFS_DOMAIN 2> /dev/null | grep -q 'dpi' && defaults read $X11_PREFS_DOMAIN dpi > /dev/null 2>&1 ; then defaultserverargs="$defaultserverargs -dpi `defaults read $X11_PREFS_DOMAIN dpi`" fi -- cgit v1.2.3