From 3c47544bb4362a4dad58884ace90639edb7f370e Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Sat, 9 Jan 2021 21:33:46 +0900 Subject: [PATCH] temporary --- main.cc | 2 +- subprocess.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cc b/main.cc index 151f378d..dbb03a03 100644 --- a/main.cc +++ b/main.cc @@ -1022,7 +1022,7 @@ int main(int argc, char **argv) { if (!config.preload) if (int code; resume_daemon(argv, &code)) - _exit(code); + exit(code); signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); diff --git a/subprocess.cc b/subprocess.cc index 135317c5..76a83e83 100644 --- a/subprocess.cc +++ b/subprocess.cc @@ -188,6 +188,9 @@ void daemonize(char **argv, std::function *wait_for_client, if (conn == -1) Error() << "accept failed: " << strerror(errno); unlink(socket_tmpfile); + + dup2(recv_fd(conn), STDOUT_FILENO); + dup2(recv_fd(conn), STDERR_FILENO); }; *on_complete = [=]() { write(conn, (char []){1}, 1); };