aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 89391036a..7ab9620fb 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -66,7 +66,7 @@ struct shbuf_ds {
66 /*int markInterval;*/ \ 66 /*int markInterval;*/ \
67 /* level of messages to be logged */ \ 67 /* level of messages to be logged */ \
68 int logLevel; \ 68 int logLevel; \
69USE_FEATURE_ROTATE_LOGFILE( \ 69IF_FEATURE_ROTATE_LOGFILE( \
70 /* max size of file before rotation */ \ 70 /* max size of file before rotation */ \
71 unsigned logFileSize; \ 71 unsigned logFileSize; \
72 /* number of rotated message files */ \ 72 /* number of rotated message files */ \
@@ -74,12 +74,12 @@ USE_FEATURE_ROTATE_LOGFILE( \
74 unsigned curFileSize; \ 74 unsigned curFileSize; \
75 smallint isRegular; \ 75 smallint isRegular; \
76) \ 76) \
77USE_FEATURE_REMOTE_LOG( \ 77IF_FEATURE_REMOTE_LOG( \
78 /* udp socket for remote logging */ \ 78 /* udp socket for remote logging */ \
79 int remoteFD; \ 79 int remoteFD; \
80 len_and_sockaddr* remoteAddr; \ 80 len_and_sockaddr* remoteAddr; \
81) \ 81) \
82USE_FEATURE_IPC_SYSLOG( \ 82IF_FEATURE_IPC_SYSLOG( \
83 int shmid; /* ipc shared memory id */ \ 83 int shmid; /* ipc shared memory id */ \
84 int s_semid; /* ipc semaphore id */ \ 84 int s_semid; /* ipc semaphore id */ \
85 int shm_size; \ 85 int shm_size; \
@@ -153,41 +153,41 @@ enum {
153 OPTBIT_outfile, // -O 153 OPTBIT_outfile, // -O
154 OPTBIT_loglevel, // -l 154 OPTBIT_loglevel, // -l
155 OPTBIT_small, // -S 155 OPTBIT_small, // -S
156 USE_FEATURE_ROTATE_LOGFILE(OPTBIT_filesize ,) // -s 156 IF_FEATURE_ROTATE_LOGFILE(OPTBIT_filesize ,) // -s
157 USE_FEATURE_ROTATE_LOGFILE(OPTBIT_rotatecnt ,) // -b 157 IF_FEATURE_ROTATE_LOGFILE(OPTBIT_rotatecnt ,) // -b
158 USE_FEATURE_REMOTE_LOG( OPTBIT_remotelog ,) // -R 158 IF_FEATURE_REMOTE_LOG( OPTBIT_remotelog ,) // -R
159 USE_FEATURE_REMOTE_LOG( OPTBIT_locallog ,) // -L 159 IF_FEATURE_REMOTE_LOG( OPTBIT_locallog ,) // -L
160 USE_FEATURE_IPC_SYSLOG( OPTBIT_circularlog,) // -C 160 IF_FEATURE_IPC_SYSLOG( OPTBIT_circularlog,) // -C
161 USE_FEATURE_SYSLOGD_DUP( OPTBIT_dup ,) // -D 161 IF_FEATURE_SYSLOGD_DUP( OPTBIT_dup ,) // -D
162 162
163 OPT_mark = 1 << OPTBIT_mark , 163 OPT_mark = 1 << OPTBIT_mark ,
164 OPT_nofork = 1 << OPTBIT_nofork , 164 OPT_nofork = 1 << OPTBIT_nofork ,
165 OPT_outfile = 1 << OPTBIT_outfile , 165 OPT_outfile = 1 << OPTBIT_outfile ,
166 OPT_loglevel = 1 << OPTBIT_loglevel, 166 OPT_loglevel = 1 << OPTBIT_loglevel,
167 OPT_small = 1 << OPTBIT_small , 167 OPT_small = 1 << OPTBIT_small ,
168 OPT_filesize = USE_FEATURE_ROTATE_LOGFILE((1 << OPTBIT_filesize )) + 0, 168 OPT_filesize = IF_FEATURE_ROTATE_LOGFILE((1 << OPTBIT_filesize )) + 0,
169 OPT_rotatecnt = USE_FEATURE_ROTATE_LOGFILE((1 << OPTBIT_rotatecnt )) + 0, 169 OPT_rotatecnt = IF_FEATURE_ROTATE_LOGFILE((1 << OPTBIT_rotatecnt )) + 0,
170 OPT_remotelog = USE_FEATURE_REMOTE_LOG( (1 << OPTBIT_remotelog )) + 0, 170 OPT_remotelog = IF_FEATURE_REMOTE_LOG( (1 << OPTBIT_remotelog )) + 0,
171 OPT_locallog = USE_FEATURE_REMOTE_LOG( (1 << OPTBIT_locallog )) + 0, 171 OPT_locallog = IF_FEATURE_REMOTE_LOG( (1 << OPTBIT_locallog )) + 0,
172 OPT_circularlog = USE_FEATURE_IPC_SYSLOG( (1 << OPTBIT_circularlog)) + 0, 172 OPT_circularlog = IF_FEATURE_IPC_SYSLOG( (1 << OPTBIT_circularlog)) + 0,
173 OPT_dup = USE_FEATURE_SYSLOGD_DUP( (1 << OPTBIT_dup )) + 0, 173 OPT_dup = IF_FEATURE_SYSLOGD_DUP( (1 << OPTBIT_dup )) + 0,
174}; 174};
175#define OPTION_STR "m:nO:l:S" \ 175#define OPTION_STR "m:nO:l:S" \
176 USE_FEATURE_ROTATE_LOGFILE("s:" ) \ 176 IF_FEATURE_ROTATE_LOGFILE("s:" ) \
177 USE_FEATURE_ROTATE_LOGFILE("b:" ) \ 177 IF_FEATURE_ROTATE_LOGFILE("b:" ) \
178 USE_FEATURE_REMOTE_LOG( "R:" ) \ 178 IF_FEATURE_REMOTE_LOG( "R:" ) \
179 USE_FEATURE_REMOTE_LOG( "L" ) \ 179 IF_FEATURE_REMOTE_LOG( "L" ) \
180 USE_FEATURE_IPC_SYSLOG( "C::") \ 180 IF_FEATURE_IPC_SYSLOG( "C::") \
181 USE_FEATURE_SYSLOGD_DUP( "D" ) 181 IF_FEATURE_SYSLOGD_DUP( "D" )
182#define OPTION_DECL *opt_m, *opt_l \ 182#define OPTION_DECL *opt_m, *opt_l \
183 USE_FEATURE_ROTATE_LOGFILE(,*opt_s) \ 183 IF_FEATURE_ROTATE_LOGFILE(,*opt_s) \
184 USE_FEATURE_ROTATE_LOGFILE(,*opt_b) \ 184 IF_FEATURE_ROTATE_LOGFILE(,*opt_b) \
185 USE_FEATURE_IPC_SYSLOG( ,*opt_C = NULL) 185 IF_FEATURE_IPC_SYSLOG( ,*opt_C = NULL)
186#define OPTION_PARAM &opt_m, &G.logFilePath, &opt_l \ 186#define OPTION_PARAM &opt_m, &G.logFilePath, &opt_l \
187 USE_FEATURE_ROTATE_LOGFILE(,&opt_s) \ 187 IF_FEATURE_ROTATE_LOGFILE(,&opt_s) \
188 USE_FEATURE_ROTATE_LOGFILE(,&opt_b) \ 188 IF_FEATURE_ROTATE_LOGFILE(,&opt_b) \
189 USE_FEATURE_REMOTE_LOG( ,&G.remoteAddrStr) \ 189 IF_FEATURE_REMOTE_LOG( ,&G.remoteAddrStr) \
190 USE_FEATURE_IPC_SYSLOG( ,&opt_C) 190 IF_FEATURE_IPC_SYSLOG( ,&opt_C)
191 191
192 192
193/* circular buffer variables/structures */ 193/* circular buffer variables/structures */