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:
parent
7532547c06
commit
af8b1b77fa
|
@ -42,6 +42,7 @@ main(int argc, char *argv[])
|
||||||
bool listenOnly = false;
|
bool listenOnly = false;
|
||||||
uint32 listenPort = 10900;
|
uint32 listenPort = 10900;
|
||||||
uint32 sshPort = 22;
|
uint32 sshPort = 22;
|
||||||
|
const char* command = NULL;
|
||||||
|
|
||||||
for (int32 i = 2; i < argc; i++) {
|
for (int32 i = 2; i < argc; i++) {
|
||||||
if (strcmp(argv[i], "-p") == 0) {
|
if (strcmp(argv[i], "-p") == 0) {
|
||||||
|
@ -86,9 +87,10 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
pid_t sshPID = -1;
|
pid_t sshPID = -1;
|
||||||
if (!listenOnly) {
|
if (!listenOnly) {
|
||||||
|
|
||||||
BPath terminalPath;
|
BPath terminalPath;
|
||||||
if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath) != B_OK) {
|
if (command == NULL) {
|
||||||
|
if (find_directory(B_SYSTEM_APPS_DIRECTORY, &terminalPath)
|
||||||
|
!= B_OK) {
|
||||||
printf("failed to determine system-apps directory\n");
|
printf("failed to determine system-apps directory\n");
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -96,11 +98,13 @@ main(int argc, char *argv[])
|
||||||
printf("failed to append to system-apps path\n");
|
printf("failed to append to system-apps path\n");
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
command = terminalPath.Path();
|
||||||
|
}
|
||||||
|
|
||||||
char shellCommand[4096];
|
char shellCommand[4096];
|
||||||
snprintf(shellCommand, sizeof(shellCommand),
|
snprintf(shellCommand, sizeof(shellCommand),
|
||||||
"echo connected; export TARGET_SCREEN=localhost:%lu; %s\n",
|
"echo connected; export TARGET_SCREEN=localhost:%lu; %s\n",
|
||||||
listenPort, terminalPath.Path());
|
listenPort, command);
|
||||||
|
|
||||||
int pipes[4];
|
int pipes[4];
|
||||||
if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {
|
if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {
|
||||||
|
|
Loading…
Reference in New Issue