Lines Matching refs:log_fd
32 static int log_fd = -1; variable
39 if (log_fd < 0) in log_str()
48 n = write(log_fd, prefix + done, len - done); in log_str()
61 n = write(log_fd, str + done, len - done); in log_str()
66 if (write(log_fd, "\n", 1) < 0) in log_str()
74 if (log_fd >= 0) { in log_close()
78 if (fcntl(log_fd, F_SETLKW, &lock)) in log_close()
81 close(log_fd); in log_close()
82 log_fd = -1; in log_close()
92 log_fd = open(LOGFILE, O_WRONLY | O_APPEND | O_CREAT, 0666); in log_open()
94 log_fd = open(LOGFILE, O_WRONLY | O_APPEND); in log_open()
96 if (log_fd < 0) { in log_open()
103 log_fd = open(LOGFILE, O_WRONLY | O_APPEND | O_CREAT, 0666); in log_open()
104 if (log_fd < 0) /* Nope, they didn't */ in log_open()
109 fchmod(log_fd, 0666); in log_open()
116 ret = fcntl(log_fd, F_SETLKW, &lock); /* this blocks */ in log_open()