From: Richard Weinberger Date: Sun, 18 Aug 2013 11:30:09 +0000 (+0200) Subject: um: Run UML in it's own session. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=250127216dd6635f5730752d7444bdec992aecb0;p=openwrt%2Fstaging%2Fblogic.git um: Run UML in it's own session. If UML is not run by a shell it can happen that UML will kill unrelated proceses upon a fatal exit because it issues a kill(0, ...). To prevent such oddities we create a new session in main(). Reported-and-tested-by: Richard W.M. Jones Signed-off-by: Richard Weinberger --- diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 749c96da7b99..e1704ff600ff 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c @@ -123,6 +123,8 @@ int __init main(int argc, char **argv, char **envp) setup_env_path(); + setsid(); + new_argv = malloc((argc + 1) * sizeof(char *)); if (new_argv == NULL) { perror("Mallocing argv");