From 3ace83c65f7c32b9d20d419d0b807fb8c749fdbf Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Thu, 19 Oct 2006 23:28:24 -0700 Subject: [PATCH] --- yaml --- r: 39961 b: refs/heads/master c: d9d645f06a8f50659bbae2be64ed8367ba068fc0 h: refs/heads/master i: 39959: fdd82fad0c9e3d0d3bc6807e111bceb9b74fea66 v: v3 --- [refs] | 2 +- trunk/arch/um/drivers/xterm.c | 2 -- trunk/arch/um/os-Linux/helper.c | 7 +++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 8398d56df7aa..6e7a17196b11 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b2670eacfb013169b8bf151a5078a9ef8ef86466 +refs/heads/master: d9d645f06a8f50659bbae2be64ed8367ba068fc0 diff --git a/trunk/arch/um/drivers/xterm.c b/trunk/arch/um/drivers/xterm.c index 386f8b952982..850221d9b4c9 100644 --- a/trunk/arch/um/drivers/xterm.c +++ b/trunk/arch/um/drivers/xterm.c @@ -136,8 +136,6 @@ int xterm_open(int input, int output, int primary, void *d, return(pid); } - if(data->stack == 0) free_stack(stack, 0); - if (data->direct_rcv) { new = os_rcv_fd(fd, &data->helper_pid); } else { diff --git a/trunk/arch/um/os-Linux/helper.c b/trunk/arch/um/os-Linux/helper.c index 8a78bf03b468..d13299cfa318 100644 --- a/trunk/arch/um/os-Linux/helper.c +++ b/trunk/arch/um/os-Linux/helper.c @@ -50,7 +50,8 @@ static int helper_child(void *arg) } /* Returns either the pid of the child process we run or -E* on failure. - * XXX The alloc_stack here breaks if this is called in the tracing thread */ + * XXX The alloc_stack here breaks if this is called in the tracing thread, so + * we need to receive a preallocated stack (a local buffer is ok). */ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, unsigned long *stack_out) { @@ -113,10 +114,8 @@ int run_helper(void (*pre_exec)(void *), void *pre_data, char **argv, close(fds[1]); close(fds[0]); out_free: - if (stack_out == NULL) + if ((stack_out == NULL) || (*stack_out == 0)) free_stack(stack, 0); - else - *stack_out = stack; return ret; }