]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/ntp/sntp/log.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / ntp / sntp / log.c
1 #include <config.h>
2
3 #include "log.h"
4
5 char *progname;         /* for msyslog use too */
6
7 static void cleanup_log(void);
8
9 void
10 sntp_init_logging(
11         const char *prog
12         )
13 {
14         msyslog_term = TRUE;
15         init_logging(prog, 0, FALSE);
16         msyslog_term_pid = FALSE;
17         msyslog_include_timestamp = FALSE;
18 }
19
20
21 void
22 open_logfile(
23         const char *logfile
24         )
25 {
26         change_logfile(logfile, FALSE);
27         atexit(cleanup_log);
28 }
29
30
31 static void
32 cleanup_log(void)
33 {
34         syslogit = TRUE;
35         fflush(syslog_file);
36         fclose(syslog_file);
37         syslog_file = NULL;
38 }