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(-) (limited to 'startx.cpp') 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