aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 12:52:46 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 12:52:46 +0200
commit424c0e8ee3986b886bf2d7617897577a6b84aaed (patch)
tree8f47986a5dac32827ce62ae3a645f80a30d6fa33
parentdb105546c0b56dbbc769da0cba32dc5fb3a53228 (diff)
parent46c8dce9a24535ae43d0a7086e26da3cf66a36b3 (diff)
downloadnx-libs-424c0e8ee3986b886bf2d7617897577a6b84aaed.tar.gz
nx-libs-424c0e8ee3986b886bf2d7617897577a6b84aaed.tar.bz2
nx-libs-424c0e8ee3986b886bf2d7617897577a6b84aaed.zip
Merge branch 'uli42-pr/use_nxdialog' into 3.6.x
Attributes GH PR #922: https://github.com/ArcticaProject/nx-libs/pull/922
-rw-r--r--nxcomp/src/Loop.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/nxcomp/src/Loop.cpp b/nxcomp/src/Loop.cpp
index eb7373f9f..59dd43a10 100644
--- a/nxcomp/src/Loop.cpp
+++ b/nxcomp/src/Loop.cpp
@@ -9842,19 +9842,29 @@ char *GetClientPath()
//
// Try to guess the location of the client.
//
-
- clientEnv = "/usr/NX/bin/nxclient";
+ // FIXME: replace hardcoded paths by built-time variables if possible
#ifdef __APPLE__
clientEnv = "/Applications/NX Client for OSX.app/Contents/MacOS/nxclient";
- #endif
-
- #ifdef __CYGWIN32__
+ #else
+ # if defined(__CYGWIN32__)
clientEnv = "C:\\Program Files\\NX Client for Windows\\nxclient";
+ # else
+
+ clientEnv = "/usr/NX/bin/nxclient";
+
+ struct stat fileStat;
+
+ if ((stat(clientEnv, &fileStat) == -1) && (EGET() == ENOENT))
+ {
+ clientEnv = "/usr/bin/nxdialog";
+ }
+
+ # endif
#endif
}