use daemon to close fd's and finally daemonize the process

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@149 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
imaginos
2005-04-18 06:11:33 +00:00
parent 6bdbe9d2c9
commit 1db82b6616

View File

@@ -177,10 +177,12 @@ int main(int argc, char** argv) {
}
/* keep the term from hanging on logout */
close( 0 );
close( 1 );
close( 2 );
if ( daemon( 1, 0 ) != 0 ) {
cerr << "Unable to daemonize!" << endl;
exit( 1 );
}
#endif
struct sigaction sa;