aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer/vncviewer.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-05-29 16:46:19 +0200
committerPierre Ossman <ossman@cendio.se>2018-05-29 16:50:55 +0200
commitfe2e5fca2135acec490dc7284cfbca86ebe2610b (patch)
tree44b890e6ce88f735c47740a4640b34ce687066ad /vncviewer/vncviewer.cxx
parentcb99be55d818a73be7dea51a2de4c5c16d0439a9 (diff)
parent39594b801dc041d40b1348bf2efcf6f64215cd60 (diff)
downloadtigervnc-fe2e5fca2135acec490dc7284cfbca86ebe2610b.tar.gz
tigervnc-fe2e5fca2135acec490dc7284cfbca86ebe2610b.zip
Merge branch 'unix' of https://github.com/CendioOssman/tigervnc
Diffstat (limited to 'vncviewer/vncviewer.cxx')
-rw-r--r--vncviewer/vncviewer.cxx18
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)) {