diff options
Diffstat (limited to 'vncviewer/vncviewer.cxx')
-rw-r--r-- | vncviewer/vncviewer.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index e305d798..6c0c7384 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -376,6 +376,18 @@ potentiallyLoadConfigurationFile(char *vncServerName) (strchr(vncServerName, '\\')) != NULL); if (hasPathSeparator) { +#ifndef WIN32 + struct stat sb; + + // This might be a UNIX socket, we need to check + if (stat(vncServerName, &sb) == -1) { + // Some access problem; let loadViewerParameters() deal with it... + } else { + if ((sb.st_mode & S_IFMT) == S_IFSOCK) + return; + } +#endif + try { const char* newServerName; newServerName = loadViewerParameters(vncServerName); @@ -573,7 +585,7 @@ int main(int argc, char** argv) #endif if (listenMode) { - std::list<TcpListener*> listeners; + std::list<SocketListener*> listeners; try { int port = 5500; if (isdigit(vncServerName[0])) @@ -587,7 +599,7 @@ int main(int argc, char** argv) while (sock == NULL) { fd_set rfds; FD_ZERO(&rfds); - for (std::list<TcpListener*>::iterator i = listeners.begin(); + for (std::list<SocketListener*>::iterator i = listeners.begin(); i != listeners.end(); i++) FD_SET((*i)->getFd(), &rfds); @@ -602,7 +614,7 @@ int main(int argc, char** argv) } } - for (std::list<TcpListener*>::iterator i = listeners.begin (); + for (std::list<SocketListener*>::iterator i = listeners.begin (); i != listeners.end(); i++) if (FD_ISSET((*i)->getFd(), &rfds)) { |