From 3d0bd73627f7aa19d45488eeee49781ca9faa0f8 Mon Sep 17 00:00:00 2001 From: runge Date: Sun, 16 Dec 2007 02:26:38 +0000 Subject: x11vnc: fix find_display and usleep() prototype on macosx. -display console and check DISPLAY /tmp/...:0 on macosx. implement -noxinerama. --- x11vnc/ssltools.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'x11vnc/ssltools.h') diff --git a/x11vnc/ssltools.h b/x11vnc/ssltools.h index cd61a15..ace6511 100644 --- a/x11vnc/ssltools.h +++ b/x11vnc/ssltools.h @@ -848,17 +848,29 @@ char find_display[] = "# who(1) output column 2:\n" "#gone=`last $user | grep 'gone.*no.logout' | awk '{print $2}' | grep '^:' | sed -e 's,/.*,,' | tr '\\n' '|'`\n" "#gone=\"${gone}__quite_impossible__\"\n" -"#display=`who | grep \"^${user}[ ][ ]*:[0-9]\" | egrep -v \" ($gone)\\>\" | head -n 1 \\\n" +"#display=`who 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | egrep -v \" ($gone)\\>\" | head -n 1 \\\n" "# | awk '{print $2}' | sed -e 's,/.*$,,'`\n" "poss=\"\"\n" -"list=`who | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n" -"list=\"$list \"`w -h \"$user\" | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n" -"list=\"$list \"`who | grep \"^${user}[ ]\" | awk '{print $NF}' | grep '(:[0-9]' | sed -e 's/[()]//g'`\n" -"host=`hostname | sed -e 's/\\..*$//'`\n" +"list=`who 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n" +"list=\"$list \"`w -h \"$user\" 2>/dev/null | grep \"^${user}[ ][ ]*:[0-9]\" | awk '{print $2}' | sed -e 's,/.*$,,'`\n" +"list=\"$list \"`who 2>/dev/null | grep \"^${user}[ ]\" | awk '{print $NF}' | grep '(:[0-9]' | sed -e 's/[()]//g'`\n" +"host=`hostname 2>/dev/null | sed -e 's/\\..*$//'`\n" "if [ \"X$X11VNC_FINDDISPLAY_SKIP_XAUTH\" = \"X\" ]; then\n" " list=\"$list \"`xauth list | awk '{print $1}' | grep /unix | grep \"^${host}\" | sed -e 's/^.*:/:/' | sort -n | uniq`\n" "fi\n" "\n" +"if [ \"X$uname\" = \"XDarwin\" ]; then\n" +" if who 2>/dev/null | grep -i \"^${user}[ ][ ]*console[ ]\" > /dev/null; then\n" +" echo \"DISPLAY=console\"\n" +" if [ \"X$FIND_DISPLAY_ALL\" = \"X\" ]; then\n" +" if [ \"X$showxauth\" != \"X\" ]; then\n" +" echo \"\"\n" +" fi\n" +" exit 0\n" +" fi\n" +" fi\n" +"fi\n" +"\n" "for p in $list\n" "do\n" " xa=`echo \"$p\" | awk -F, '{print $2}'`\n" -- cgit v1.2.1