aboutsummaryrefslogtreecommitdiff
path: root/nxcomp
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-05-05 19:29:47 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-05-07 12:52:00 +0200
commit46c8dce9a24535ae43d0a7086e26da3cf66a36b3 (patch)
tree8f47986a5dac32827ce62ae3a645f80a30d6fa33 /nxcomp
parentdb105546c0b56dbbc769da0cba32dc5fb3a53228 (diff)
downloadnx-libs-46c8dce9a24535ae43d0a7086e26da3cf66a36b3.tar.gz
nx-libs-46c8dce9a24535ae43d0a7086e26da3cf66a36b3.tar.bz2
nx-libs-46c8dce9a24535ae43d0a7086e26da3cf66a36b3.zip
Use nxdialog as nxclient replacement
if neither NX_CLIENT ist provided nor /usr/NX/bin/nxclient is existing try /usr/bin/nxdialog. Currently the path is hardcoded.
Diffstat (limited to 'nxcomp')
-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
}