lib/daemon.c
/* Close standard file descriptors (except any that the client has requested we
 * leave open by calling daemon_save_fd()).  If we're started from e.g. an SSH
 * session, then this keeps us from holding that session open artificially. */
Close standard file descriptors (except any that the client has requested we
leave open by calling daemon_save_fd()).  If we're started from e.g. an SSH
session, then this keeps us from holding that session open artificially.
Close standard file descriptors ( except any that the client has requested we leave open by calling daemon_save_fd () ) . If we ' re started from e . g . an SSH session then this keeps us from holding that session open artificially .
void
close_standard_fds(void)
{
    int null_fd = get_null_fd();
    if (null_fd >= 0) {
        int fd;
        for (fd = 0; fd < 3; fd++) {
            if (!save_fds[fd]) {
                dup2(null_fd, fd);
            }
        }
    }
    vlog_set_levels(NULL, VLF_CONSOLE, VLL_OFF);
}
void close_standard_fds ( void ) { int null_fd = get_null_fd ( ) ; if ( null_fd >= 0 ) { int fd ; for ( fd = 0 ; fd < 3 ; fd ++ ) { if ( ! save_fds [ fd ] ) { dup2 ( null_fd , fd ) ; } } } vlog_set_levels ( NULL , VLF_CONSOLE , VLL_OFF ) ; }
Close standard file descriptors (except any that the client has requested we
 leave open by calling daemon_save_fd()).
Close standard file descriptors ( except any that the client has requested we leave open by calling daemon_save_fd () ) .
/* Disable logging to stderr to avoid wasting CPU time. */