* Run the worker in a separate session to prevent terminal signals
from interfering.
This commit is contained in:
parent
e25fad691a
commit
714fa24cfb
1 changed files with 6 additions and 0 deletions
|
@ -164,6 +164,12 @@ void run(Strings args)
|
||||||
if (slave) {
|
if (slave) {
|
||||||
FdSource source(STDIN_FILENO);
|
FdSource source(STDIN_FILENO);
|
||||||
FdSink sink(STDOUT_FILENO);
|
FdSink sink(STDOUT_FILENO);
|
||||||
|
|
||||||
|
/* This prevents us from receiving signals from the terminal
|
||||||
|
when we're running in setuid mode. */
|
||||||
|
if (setsid() == -1)
|
||||||
|
throw SysError(format("creating a new session"));
|
||||||
|
|
||||||
processConnection(source, sink);
|
processConnection(source, sink);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue