summaryrefslogtreecommitdiff
path: root/arch/um/drivers/net_user.c
diff options
context:
space:
mode:
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>2006-04-10 22:53:37 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 06:18:36 -0700
commitb1c332c9e813cbee6ca77c3a66ee4d312eb96770 (patch)
tree8ce0329e77d6c293b0c15ef1d163a81cb1e1a950 /arch/um/drivers/net_user.c
parente6fb54abb8a36703f54b7e27a756a3df6667c37b (diff)
[PATCH] uml: fix hang on run_helper() failure on uml_net
Fix an hang on a pipe when run_helper() fails when called by change_tramp() (i.e. when calling uml_net) - reproduced the bug and verified this fixes it. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/net_user.c')
-rw-r--r--arch/um/drivers/net_user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 0e2f06187ea7..0a7786e00cfb 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -182,7 +182,9 @@ static int change_tramp(char **argv, char *output, int output_len)
pe_data.stdout = fds[1];
pid = run_helper(change_pre_exec, &pe_data, argv, NULL);
- read_output(fds[0], output, output_len);
+ if (pid > 0) /* Avoid hang as we won't get data in failure case. */
+ read_output(fds[0], output, output_len);
+
os_close_file(fds[0]);
os_close_file(fds[1]);