X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=execute.c;h=357fd5c20874aea7a6c670b89f7e737f64aa3fb1;hb=8d567588cad053f79abe603ab113e1b85a92f1da;hp=dfedb31a5312f652ac6da60584a4185fa9bb3bd5;hpb=4f2d528d3bb25cebf8d3ebe83d8193ab4016cb90;p=elogind.git diff --git a/execute.c b/execute.c index dfedb31a5..357fd5c20 100644 --- a/execute.c +++ b/execute.c @@ -788,10 +788,11 @@ int exec_spawn(ExecCommand *command, goto fail; } - if (setsid() < 0) { - r = EXIT_SETSID; - goto fail; - } + if (!context->no_setsid) + if (setsid() < 0) { + r = EXIT_SETSID; + goto fail; + } umask(context->umask);