Browse code

- reverted LOG_NONE syslog_facility enabling no-syslog feature

Tomas Mandys authored on 01/09/2006 10:51:10
Showing 3 changed files
... ...
@@ -198,8 +198,7 @@ int daemonize(char*  name)
198 198
 	}
199 199
 	
200 200
 	if (log_stderr==0)
201
-		if (log_facility!=LOG_NONE)
202
-			openlog(name, LOG_PID|LOG_CONS, log_facility);
201
+		openlog(name, LOG_PID|LOG_CONS, log_facility);
203 202
 		/* LOG_CONS, LOG_PERRROR ? */
204 203
 
205 204
 	return  0;
... ...
@@ -45,17 +45,15 @@ static char* str_fac[]={"LOG_AUTH","LOG_CRON","LOG_DAEMON",
45 45
 #ifndef __OS_solaris
46 46
 					"LOG_AUTHPRIV","LOG_FTP","LOG_SYSLOG",
47 47
 #endif
48
-					"LOG_NONE",
49 48
 					0};
50 49
 static int int_fac[]={LOG_AUTH ,  LOG_CRON , LOG_DAEMON ,
51 50
 					LOG_KERN , LOG_LOCAL0 , LOG_LOCAL1 ,
52 51
 					LOG_LOCAL2 , LOG_LOCAL3 , LOG_LOCAL4 , LOG_LOCAL5 ,
53 52
 					LOG_LOCAL6 , LOG_LOCAL7 , LOG_LPR , LOG_MAIL ,
54
-					LOG_NEWS , LOG_USER , LOG_UUCP,
53
+					LOG_NEWS , LOG_USER , LOG_UUCP
55 54
 #ifndef __OS_solaris
56
-					LOG_AUTHPRIV,LOG_FTP,LOG_SYSLOG,
55
+					,LOG_AUTHPRIV,LOG_FTP,LOG_SYSLOG
57 56
 #endif
58
-					LOG_NONE
59 57
 					};
60 58
 
61 59
 
... ...
@@ -32,8 +32,6 @@
32 32
 
33 33
 #include <syslog.h>
34 34
 
35
-/* define non existing facility to disable logging */
36
-#define LOG_NONE (~LOG_FACMASK)
37 35
 
38 36
 #define L_ALERT -3
39 37
 #define L_CRIT  -2
... ...
@@ -93,7 +91,7 @@ int str2facility(char *s);
93 93
 					if (log_stderr){ \
94 94
 						dprint (__VA_ARGS__); \
95 95
 					}else{ \
96
-						if (log_facility!=LOG_NONE) syslog(DPRINT_LEV|log_facility,  __VA_ARGS__); \
96
+						syslog(DPRINT_LEV|log_facility,  __VA_ARGS__); \
97 97
 					}\
98 98
 				} \
99 99
 			}while(0)
... ...
@@ -104,7 +102,7 @@ int str2facility(char *s);
104 104
 					if (log_stderr){ \
105 105
 						dprint (fmt, ## args); \
106 106
 					}else{ \
107
-						if (log_facility!=LOG_NONE) syslog(DPRINT_LEV|log_facility, fmt, ## args); \
107
+						syslog(DPRINT_LEV|log_facility, fmt, ## args); \
108 108
 					}\
109 109
 				} \
110 110
 			}while(0)
... ...
@@ -128,7 +126,7 @@ int str2facility(char *s);
128 128
 			do { \
129 129
 				if (debug>=(lev)){ \
130 130
 					if (log_stderr) dprint (__VA_ARGS__); \
131
-					else if (log_facility!=LOG_NONE) { \
131
+					else { \
132 132
 						switch(lev){ \
133 133
 							case L_CRIT: \
134 134
 								syslog(LOG_CRIT|log_facility, __VA_ARGS__); \
... ...
@@ -160,7 +158,7 @@ int str2facility(char *s);
160 160
 			do { \
161 161
 				if (debug>=(lev)){ \
162 162
 					if (log_stderr) dprint (fmt, ## args); \
163
-					else if (log_facility!=LOG_NONE) { \
163
+					else { \
164 164
 						switch(lev){ \
165 165
 							case L_CRIT: \
166 166
 								syslog(LOG_CRIT|log_facility, fmt, ##args); \