Skip to content
Snippets Groups Projects
Commit 06b4aa95 authored by George Nachman's avatar George Nachman
Browse files

Adhoc build 3.1.20170513_113452

parent 1cdc0b4a
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -610,10 +610,6 @@ static int MyForkPty(int *amaster,
free(newEnviron);
return;
}
for (int j = 0; newEnviron[j]; j++) {
free(newEnviron[j]);
}
free(newEnviron);
 
// Make sure the master side of the pty is closed on future exec() calls.
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
Loading
Loading
@@ -654,6 +650,16 @@ static int MyForkPty(int *amaster,
fcntl(fd, F_SETFL, O_NONBLOCK);
[[TaskNotifier sharedInstance] registerTask:self];
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
for (int j = 0; newEnviron[j]; j++) {
if (strncmp("PATH=", newEnviron[j], 5) == 0) {
NSString *message = [NSString stringWithFormat:@"PTYTask set PATH before exec to %s\r\n", newEnviron[j]];
[_delegate threadedReadTask:(char *)message.UTF8String length:strlen(message.UTF8String)];
}
free(newEnviron[j]);
}
free(newEnviron);
});
}
 
- (void)registerAsCoprocessOnlyTask {
Loading
Loading
Loading
Loading
@@ -52,7 +52,7 @@ int launch_shell(void) {
if (len >= MAXPATHLEN) {
errx(1, "shell path is too long");
}
printf("shell_launcher: Exec'ing your shell %s with PATH=%s\r\n", shell, getenv("PATH"));
execlp(shell, argv0, (char*)0);
err(1, "Failed to exec %s with arg %s", shell, argv0);
}
Loading
Loading
@@ -66,6 +66,7 @@ static void ExecChild(int argc, char *const *argv) {
dup2(kPtySlaveFileDescriptor, 0);
dup2(kPtySlaveFileDescriptor, 2);
 
printf("ExecChild: command=%s PATH=%s\r\n", argv[0], getenv("PATH"));
// TODO: The first arg should be just the last path component.
execvp(argv[0], argv);
int error = errno;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment