Lines Matching refs:log_fd
38 static int log_fd = -1; variable
91 if (log_to_file && ent_pw && ent_pw->pw_uid != 0 && fchown(log_fd, ent_pw->pw_uid, -1) != 0) in log_start()
98 if (log_fd != -1) close(log_fd); in log_reopen()
103 log_fd = open(log_file, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR | S_IRGRP); in log_reopen()
104 return log_fd != -1; in log_reopen()
108 log_fd = -1; in log_reopen()
112 log_fd = socket(AF_UNIX, connection_type, 0); in log_reopen()
114 if (log_fd == -1) return 0; in log_reopen()
117 if (max_logs != 0 && (flags = fcntl(log_fd, F_GETFL)) != -1) in log_reopen()
118 fcntl(log_fd, F_SETFL, flags | O_NONBLOCK); in log_reopen()
144 if ((rc = write(log_fd, entries->payload + entries->offset, entries->length)) != -1) { in log_write()
187 if (connect(log_fd, (struct sockaddr*) &logaddr, sizeof(logaddr)) != -1) continue; in log_write()
207 log_fd = -1; in log_write()
258 if (log_fd == -1) { in my_syslog()
348 if (entries && log_fd != -1 && connection_good) { in set_log_writer()
349 FD_SET(log_fd, set); in set_log_writer()
350 bump_maxfd(log_fd, maxfdp); in set_log_writer()
355 if (log_fd != -1 && (!set || FD_ISSET(log_fd, set))) log_write(); in check_log_writer()
360 if (log_fd != -1) { in flush_log()
362 if ((flags = fcntl(log_fd, F_GETFL)) != -1) fcntl(log_fd, F_SETFL, flags & ~O_NONBLOCK); in flush_log()
364 close(log_fd); in flush_log()