Fixed RemoteDesktop build that has been broken with hrev43319.

* Or more specifically, in 323b65468e, part of that revision (ie. the initial
  import from Oliver).
This commit is contained in:
Axel Dörfler 2012-01-10 23:05:01 +01:00
parent 7532547c06
commit af8b1b77fa
1 changed files with 13 additions and 9 deletions

View File

@ -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) {