summaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-08-18 13:30:09 +0200
committerRichard Weinberger <richard@nod.at>2013-09-07 10:57:07 +0200
commit250127216dd6635f5730752d7444bdec992aecb0 (patch)
tree568f2faaf4f8e86d54902aa8a1927afd51ff9fbf /arch/um/os-Linux
parent91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3 (diff)
downloadlinux-250127216dd6635f5730752d7444bdec992aecb0.tar.bz2
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 <rjones@redhat.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/os-Linux')
-rw-r--r--arch/um/os-Linux/main.c2
1 files changed, 2 insertions, 0 deletions
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");