aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2013-08-18 07:30:09 -0400
committerRichard Weinberger <richard@nod.at>2013-09-07 04:57:07 -0400
commit250127216dd6635f5730752d7444bdec992aecb0 (patch)
tree568f2faaf4f8e86d54902aa8a1927afd51ff9fbf /arch/um
parent91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3 (diff)
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')
-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)
123 123
124 setup_env_path(); 124 setup_env_path();
125 125
126 setsid();
127
126 new_argv = malloc((argc + 1) * sizeof(char *)); 128 new_argv = malloc((argc + 1) * sizeof(char *));
127 if (new_argv == NULL) { 129 if (new_argv == NULL) {
128 perror("Mallocing argv"); 130 perror("Mallocing argv");