From b1c12d2fba6875d3b7082755729476eeb163b827 Mon Sep 17 00:00:00 2001 From: prozacx Date: Mon, 18 Apr 2005 22:11:35 +0000 Subject: [PATCH] Removed call to daemon() since it forks and was changing our pid git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@151 726aef4b-f618-498e-8847-2d620e286838 --- main.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 567000bd..98a021d7 100644 --- a/main.cpp +++ b/main.cpp @@ -176,13 +176,11 @@ int main(int argc, char** argv) { exit(0); } - /* keep the term from hanging on logout */ - if ( daemon( 1, 0 ) != 0 ) { - cerr << "Unable to daemonize!" << endl; - exit( 1 ); - } + // Redirect std in/out/err to /dev/null + close(0); open("/dev/null", O_RDONLY); + close(1); open("/dev/null", O_WRONLY); + close(2); open("/dev/null", O_WRONLY); - #endif struct sigaction sa;