From af8b1b77fada0f3108a3d1b22c0767c840d903f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 10 Jan 2012 23:05:01 +0100 Subject: [PATCH] Fixed RemoteDesktop build that has been broken with hrev43319. * Or more specifically, in 323b65468e58, part of that revision (ie. the initial import from Oliver). --- src/apps/remotedesktop/RemoteDesktop.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/apps/remotedesktop/RemoteDesktop.cpp b/src/apps/remotedesktop/RemoteDesktop.cpp index 75a92e91da..050a860e16 100644 --- a/src/apps/remotedesktop/RemoteDesktop.cpp +++ b/src/apps/remotedesktop/RemoteDesktop.cpp @@ -42,6 +42,7 @@ main(int argc, char *argv[]) bool listenOnly = false; uint32 listenPort = 10900; uint32 sshPort = 22; + const char* command = NULL; for (int32 i = 2; i < argc; i++) { if (strcmp(argv[i], "-p") == 0) { @@ -86,21 +87,24 @@ main(int argc, char *argv[]) pid_t sshPID = -1; if (!listenOnly) { - BPath terminalPath; - if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath) != B_OK) { - printf("failed to determine system-apps directory\n"); - return 3; - } - if (terminalPath.Append("Terminal") != B_OK) { - printf("failed to append to system-apps path\n"); - return 3; + if (command == NULL) { + if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath) + != B_OK) { + printf("failed to determine system-apps directory\n"); + return 3; + } + if (terminalPath.Append("Terminal") != B_OK) { + printf("failed to append to system-apps path\n"); + return 3; + } + command = terminalPath.Path(); } char shellCommand[4096]; snprintf(shellCommand, sizeof(shellCommand), "echo connected; export TARGET_SCREEN=localhost:%lu; %s\n", - listenPort, terminalPath.Path()); + listenPort, command); int pipes[4]; if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {