From 29f5709c53d216b9cf3ce89d74003788ca60e526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 22 Feb 2015 03:12:54 +0100 Subject: [PATCH] qrexec: fork into background after setting up qrexec-fork-server socket This allows qubes-session signalling dom0 when session is really ready. --- qrexec/qrexec-fork-server.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qrexec/qrexec-fork-server.c b/qrexec/qrexec-fork-server.c index da03238..681e626 100644 --- a/qrexec/qrexec-fork-server.c +++ b/qrexec/qrexec-fork-server.c @@ -94,6 +94,16 @@ int main(int argc, char **argv) { perror("fcntl"); exit(1); } + /* fork into background */ + switch (fork()) { + case -1: + perror("fork"); + exit(1); + case 0: + break; + default: + exit(0); + } signal(SIGCHLD, SIG_IGN); register_exec_func(do_exec);