From f837124ab1c018791994ce44d3389aac047355f2 Mon Sep 17 00:00:00 2001 From: Bert Gijsbers Date: Thu, 28 Sep 2023 19:04:26 +0200 Subject: [PATCH] After daemonizing reopen the output file. --- src/icewmbg.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/icewmbg.cc b/src/icewmbg.cc index adbf2603b..8cdb48098 100644 --- a/src/icewmbg.cc +++ b/src/icewmbg.cc @@ -2,8 +2,6 @@ #include #include -#include -#include #include #include #include @@ -1292,8 +1290,12 @@ int main(int argc, char **argv) { if (trans.nonempty()) trans.clear(); - if (daemonize) - daemon(1, 0); + if (daemonize) { + if (daemon(1, 0) == -1) + fail("daemon"); + if (nonempty(outputArg)) + upath::redirectOutput(outputArg); + } return bg.mainLoop(); }