003 File Manager
Current Path:
/usr/src/contrib/ntp/sntp
usr
/
src
/
contrib
/
ntp
/
sntp
/
📁
..
📄
COPYRIGHT
(11.68 KB)
📄
Makefile.am
(7.73 KB)
📄
Makefile.in
(57.02 KB)
📄
aclocal.m4
(48.79 KB)
📁
ag-tpl
📄
bincheck.mf
(605 B)
📄
check-libntp.mf
(324 B)
📄
check-libopts.mf
(350 B)
📄
config.h.in
(25.57 KB)
📄
configure
(761.77 KB)
📄
configure.ac
(3.83 KB)
📄
crypto.c
(7.33 KB)
📄
crypto.h
(799 B)
📄
data_formats.h
(117 B)
📄
deps-ver
(29 B)
📄
depsver.mf
(2.2 KB)
📁
harden
📁
include
📄
includes.mf
(254 B)
📄
invoke-sntp.menu
(49 B)
📄
invoke-sntp.texi
(15.32 KB)
📄
kod_management.c
(5.62 KB)
📄
kod_management.h
(450 B)
📁
libevent
📁
libopts
📁
libpkgver
📁
loc
📄
log.c
(754 B)
📄
log.h
(518 B)
📁
m4
📄
main.c
(34.64 KB)
📄
main.h
(875 B)
📄
networking.c
(7.28 KB)
📄
networking.h
(3.16 KB)
📄
scm-rev
(7 B)
📁
scripts
📄
sntp-opts.c
(56.65 KB)
📄
sntp-opts.def
(8.66 KB)
📄
sntp-opts.h
(12.16 KB)
📄
sntp.1sntpman
(12.08 KB)
📄
sntp.1sntpmdoc
(10.64 KB)
📄
sntp.c
(125 B)
📄
sntp.html
(31.16 KB)
📄
sntp.man.in
(12.09 KB)
📄
sntp.mdoc.in
(10.65 KB)
📄
sntp.texi
(2.41 KB)
📁
tests
📁
unity
📄
utilities.c
(3.63 KB)
📄
utilities.h
(754 B)
📄
version.c
(135 B)
Editing: log.c
#include <config.h> #include "log.h" const char *progname; /* for msyslog use too */ static int counter = 0; static void cleanup_log(void); void sntp_init_logging( const char *prog ) { msyslog_term = TRUE; init_logging(prog, 0, FALSE); msyslog_term_pid = FALSE; msyslog_include_timestamp = FALSE; } void open_logfile( const char *logfile ) { change_logfile(logfile, FALSE); counter = 1; //counter++; atexit(cleanup_log); } //not sure about this. Are the atexit() functions called by FIFO or LIFO order? The end result is PROBABLY the same static void cleanup_log(void) { //counter--; //if(counter <= 0){ if(counter == 1){ syslogit = TRUE; fflush(syslog_file); fclose(syslog_file); syslog_file = NULL; counter = 0; } }
Upload File
Create Folder