exit(1);
}
+static void
+potentiallyLoadConfigurationFile(char *vncServerName)
+{
+ const bool hasPathSeparator = (strchr(vncServerName, '/') != NULL ||
+ (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);
+ // This might be empty, but we still need to clear it so we
+ // don't try to connect to the filename
+ strncpy(vncServerName, newServerName, VNCSERVERNAMELEN);
+ } catch (rfb::Exception& e) {
+ vlog.error("%s", e.str());
+ if (alertOnFatalError)
+ fl_alert("%s", e.str());
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
#ifndef WIN32
static int
interpretViaParam(char *remoteHost, int *remotePort, int localPort)