diff options
author | Richard Weinberger <richard@nod.at> | 2013-08-18 07:30:09 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2013-09-07 04:57:07 -0400 |
commit | 250127216dd6635f5730752d7444bdec992aecb0 (patch) | |
tree | 568f2faaf4f8e86d54902aa8a1927afd51ff9fbf /arch | |
parent | 91d44ff860a9e9c0db81a89cbc24fa31fbd8e6d3 (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')
-rw-r--r-- | arch/um/os-Linux/main.c | 2 |
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"); |