diff options
author | DRC <dcommander@users.sourceforge.net> | 2009-04-16 20:56:25 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2009-04-16 20:56:25 +0000 |
commit | 5e6c57fea23b3cfd3bda77e6c66fed087ea08546 (patch) | |
tree | 1c16c8c2b0668133dbfb08dd4d43ecd747e34c2a | |
parent | fc3c93e60f5bc5cdc472ce862f485d211fbce7cf (diff) | |
download | tigervnc-5e6c57fea23b3cfd3bda77e6c66fed087ea08546.tar.gz tigervnc-5e6c57fea23b3cfd3bda77e6c66fed087ea08546.zip |
It shouldn't be necessary to actually open the XFS unix socket. If the socket file exists, then XFS is running.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3782 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rwxr-xr-x | unix/vncserver | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/unix/vncserver b/unix/vncserver index 1578a5e0..873e8db7 100755 --- a/unix/vncserver +++ b/unix/vncserver @@ -403,23 +403,20 @@ sub CheckDisplayNumber sub CheckXFS { - if (@_ == 1) { - socket(S, $AF_UNIX, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n"; - eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))'; - if (!bind(S, pack('S a108', $AF_UNIX, 7100))) { - close(S); - return 0; + if ($_[0] == 1) { + if (-e "/tmp/.font-unix/fs7100") { + return 1; } } else { socket(S, $AF_INET, $SOCK_STREAM, 0) || die "$prog: socket failed: $!\n"; eval 'setsockopt(S, &SOL_SOCKET, &SO_REUSEADDR, pack("l", 1))'; - if (!bind(S, pack('S n a4 x8', $AF_INET, 7100))) { + if (!bind(S, pack('S n x12', $AF_INET, 7100))) { close(S); - return 0; + return 1; } } close(S); - return 1; + return 0; } @@ -714,20 +711,16 @@ sub SanityCheck if (($os eq "SunOS") && ($osrev !~ /^4/)) { $AF_INET = 2; $SOCK_STREAM = 2; - $AF_UNIX = 1; } else { $AF_INET = 2; $SOCK_STREAM = 1; - $AF_UNIX = 1; } } else { $AF_INET = &AF_INET; $SOCK_STREAM = &SOCK_STREAM; - $AF_UNIX = &AF_UNIX; } } else { $AF_INET = &AF_INET; $SOCK_STREAM = &SOCK_STREAM; - $AF_UNIX = &AF_UNIX; } } |