Flat commit of all changes from package-management branch in svn
This commit is contained in:
committed by
Ingo Weinhold
parent
b353a9a30a
commit
3dfd9cb95c
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include <Application.h>
|
||||
#include <FindDirectory.h>
|
||||
#include <Path.h>
|
||||
#include <Screen.h>
|
||||
#include <Window.h>
|
||||
|
||||
@@ -40,7 +42,6 @@ main(int argc, char *argv[])
|
||||
bool listenOnly = false;
|
||||
uint32 listenPort = 10900;
|
||||
uint32 sshPort = 22;
|
||||
const char *command = "/system/apps/Terminal";
|
||||
|
||||
for (int32 i = 2; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-p") == 0) {
|
||||
@@ -85,10 +86,21 @@ 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;
|
||||
}
|
||||
|
||||
char shellCommand[4096];
|
||||
snprintf(shellCommand, sizeof(shellCommand),
|
||||
"echo connected; export TARGET_SCREEN=localhost:%lu; %s\n",
|
||||
listenPort, command);
|
||||
listenPort, terminalPath.Path());
|
||||
|
||||
int pipes[4];
|
||||
if (pipe(&pipes[0]) != 0 || pipe(&pipes[2]) != 0) {
|
||||
|
||||
Reference in New Issue
Block a user