added a new parameter 'close_files' to App::daemonize()

This commit is contained in:
2021-12-06 16:22:10 +00:00
parent bb0fc4944d
commit d3a04da539
2 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ void App::setName (const qse_char_t* name) QSE_CPP_NOEXCEPT
qse_log_setident (&this->_log.logger, name);
}
int App::daemonize (bool chdir_to_root, int fork_count, bool root_only) QSE_CPP_NOEXCEPT
int App::daemonize (bool chdir_to_root, int fork_count, bool root_only, bool close_files) QSE_CPP_NOEXCEPT
{
if (root_only && QSE_GETEUID() != 0) return -1;
@ -152,7 +152,7 @@ int App::daemonize (bool chdir_to_root, int fork_count, bool root_only) QSE_CPP_
QSE_UMASK (0);
if (chdir_to_root) QSE_CHDIR("/"); // don't care about failure
if (true)
if (close_files)
{
int keep[] = { 0, 1, 2};