Browse code

small cleanups

git-svn: trunk@455

Tomasz Kojm authored on 2004/03/31 06:11:25
Showing 12 changed files
... ...
@@ -1,3 +1,8 @@
1
+Tue Mar 30 23:18:49 CEST 2004 (tk)
2
+----------------------------------
3
+  * clamav-milter: adapt Makefile to new directory structure
4
+  * small code cleanup
5
+
1 6
 Tue Mar 30 08:40:10 BST 2004 (trog)
2 7
 -----------------------------------
3 8
   * clamav.conf, shared/cfgparser.c: recognise ReadTimeout option
... ...
@@ -21,9 +21,12 @@ if HAVE_MILTER
21 21
 
22 22
 sbin_PROGRAMS = clamav-milter
23 23
 
24
-clamav_milter_SOURCES = clamav-milter.c
25
-
26
-clamav_milter_LDADD = $(top_builddir)/clamd/cfgfile.o $(top_builddir)/clamd/others.o $(top_builddir)/clamscan/getopt.o
24
+clamav_milter_SOURCES = 
25
+    $(top_srcdir)/shared/cfgparser.c \
26
+    $(top_srcdir)/shared/cfgparser.h \
27
+    $(top_srcdir)/shared/getopt.c \
28
+    $(top_srcdir)/shared/getopt.h \
29
+    clamav-milter.c
27 30
 
28 31
 man_MANS = $(top_srcdir)/docs/man/clamav-milter.8
29 32
 
... ...
@@ -33,5 +36,5 @@ endif
33 33
 DEFS = @DEFS@ -DSENDMAIL_BIN=\"@SENDMAIL@\"
34 34
 # CLAMD_LIBS is used, because clamav-milter requires the same libraries as clamd
35 35
 LIBS = -L$(top_builddir)/libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMAV_MILTER_LIBS@
36
-INCLUDES = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared -I$(top_srcdir)/clamscan
36
+INCLUDES = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared
37 37
 EXTRA_DIST = clamav-milter.c INSTALL
... ...
@@ -120,16 +120,14 @@ install_sh = @install_sh@
120 120
 # FIXME: check automake for 'and' (&&)
121 121
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@sbin_PROGRAMS = clamav-milter
122 122
 
123
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_SOURCES = clamav-milter.c
124
-
125
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_LDADD = $(top_builddir)/clamd/cfgfile.o $(top_builddir)/clamd/others.o $(top_builddir)/clamscan/getopt.o
123
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_SOURCES = 
126 124
 
127 125
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@man_MANS = $(top_srcdir)/docs/man/clamav-milter.8
128 126
 
129 127
 DEFS = @DEFS@ -DSENDMAIL_BIN=\"@SENDMAIL@\"
130 128
 # CLAMD_LIBS is used, because clamav-milter requires the same libraries as clamd
131 129
 LIBS = -L$(top_builddir)/libclamav -lclamav -L/usr/lib/libmilter -lmilter @CLAMAV_MILTER_LIBS@
132
-INCLUDES = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared -I$(top_srcdir)/clamscan
130
+INCLUDES = -I$(top_srcdir)/clamd -I$(top_srcdir)/libclamav -I$(top_srcdir)/shared
133 131
 EXTRA_DIST = clamav-milter.c INSTALL
134 132
 subdir = clamav-milter
135 133
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
... ...
@@ -142,23 +140,15 @@ CONFIG_CLEAN_FILES =
142 142
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_FALSE@sbin_PROGRAMS =
143 143
 PROGRAMS = $(sbin_PROGRAMS)
144 144
 
145
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am_clamav_milter_OBJECTS = \
146
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	clamav-milter.$(OBJEXT)
145
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am_clamav_milter_OBJECTS =
147 146
 clamav_milter_OBJECTS = $(am_clamav_milter_OBJECTS)
148
-@BUILD_CLAMD_FALSE@@HAVE_MILTER_TRUE@clamav_milter_DEPENDENCIES =
149
-@BUILD_CLAMD_FALSE@@HAVE_MILTER_FALSE@clamav_milter_DEPENDENCIES =
150
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@clamav_milter_DEPENDENCIES = \
151
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	$(top_builddir)/clamd/cfgfile.o \
152
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	$(top_builddir)/clamd/others.o \
153
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	$(top_builddir)/clamscan/getopt.o
154
-@BUILD_CLAMD_TRUE@@HAVE_MILTER_FALSE@clamav_milter_DEPENDENCIES =
147
+clamav_milter_LDADD = $(LDADD)
148
+clamav_milter_DEPENDENCIES =
155 149
 clamav_milter_LDFLAGS =
156 150
 DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
157 151
 CPPFLAGS = @CPPFLAGS@
158 152
 LDFLAGS = @LDFLAGS@
159
-depcomp = $(SHELL) $(top_srcdir)/depcomp
160
-am__depfiles_maybe = depfiles
161
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/clamav-milter.Po
153
+CFLAGS = @CFLAGS@
162 154
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
163 155
 	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
164 156
 LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
... ...
@@ -166,7 +156,6 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
166 166
 CCLD = $(CC)
167 167
 LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
168 168
 	$(AM_LDFLAGS) $(LDFLAGS) -o $@
169
-CFLAGS = @CFLAGS@
170 169
 DIST_SOURCES = $(clamav_milter_SOURCES)
171 170
 
172 171
 NROFF = nroff
... ...
@@ -177,7 +166,6 @@ SOURCES = $(clamav_milter_SOURCES)
177 177
 all: all-am
178 178
 
179 179
 .SUFFIXES:
180
-.SUFFIXES: .c .lo .o .obj
181 180
 $(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
182 181
 	cd $(top_srcdir) && \
183 182
 	  $(AUTOMAKE) --gnu  clamav-milter/Makefile
... ...
@@ -220,30 +208,6 @@ mostlyclean-compile:
220 220
 distclean-compile:
221 221
 	-rm -f *.tab.c
222 222
 
223
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamav-milter.Po@am__quote@
224
-
225
-distclean-depend:
226
-	-rm -rf ./$(DEPDIR)
227
-
228
-.c.o:
229
-@AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
230
-@AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
231
-@AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
232
-	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
233
-
234
-.c.obj:
235
-@AMDEP_TRUE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
236
-@AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
237
-@AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
238
-	$(COMPILE) -c `cygpath -w $<`
239
-
240
-.c.lo:
241
-@AMDEP_TRUE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
242
-@AMDEP_TRUE@	depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
243
-@AMDEP_TRUE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
244
-	$(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
245
-CCDEPMODE = @CCDEPMODE@
246
-
247 223
 mostlyclean-libtool:
248 224
 	-rm -f *.lo
249 225
 
... ...
@@ -292,42 +256,9 @@ uninstall-man8:
292 292
 	  echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
293 293
 	  rm -f $(DESTDIR)$(man8dir)/$$inst; \
294 294
 	done
295
-
296
-ETAGS = etags
297
-ETAGSFLAGS =
298
-
299 295
 tags: TAGS
296
+TAGS:
300 297
 
301
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
302
-	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
303
-	unique=`for i in $$list; do \
304
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
305
-	  done | \
306
-	  $(AWK) '    { files[$$0] = 1; } \
307
-	       END { for (i in files) print i; }'`; \
308
-	mkid -fID $$unique
309
-
310
-TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
311
-		$(TAGS_FILES) $(LISP)
312
-	tags=; \
313
-	here=`pwd`; \
314
-	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
315
-	unique=`for i in $$list; do \
316
-	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
317
-	  done | \
318
-	  $(AWK) '    { files[$$0] = 1; } \
319
-	       END { for (i in files) print i; }'`; \
320
-	test -z "$(ETAGS_ARGS)$$tags$$unique" \
321
-	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
322
-	     $$tags $$unique
323
-
324
-GTAGS:
325
-	here=`$(am__cd) $(top_builddir) && pwd` \
326
-	  && cd $(top_srcdir) \
327
-	  && gtags -i $(GTAGS_ARGS) $$here
328
-
329
-distclean-tags:
330
-	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
331 298
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
332 299
 
333 300
 top_distdir = ..
... ...
@@ -391,8 +322,8 @@ clean-am: clean-generic clean-libtool clean-sbinPROGRAMS mostlyclean-am
391 391
 
392 392
 distclean: distclean-am
393 393
 
394
-distclean-am: clean-am distclean-compile distclean-depend \
395
-	distclean-generic distclean-libtool distclean-tags
394
+distclean-am: clean-am distclean-compile distclean-generic \
395
+	distclean-libtool
396 396
 
397 397
 dvi: dvi-am
398 398
 
... ...
@@ -425,19 +356,23 @@ uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS
425 425
 
426 426
 uninstall-man: uninstall-man8
427 427
 
428
-.PHONY: GTAGS all all-am check check-am clean clean-generic \
429
-	clean-libtool clean-sbinPROGRAMS distclean distclean-compile \
430
-	distclean-depend distclean-generic distclean-libtool \
431
-	distclean-tags distdir dvi dvi-am info info-am install \
432
-	install-am install-data install-data-am install-exec \
433
-	install-exec-am install-info install-info-am install-man \
434
-	install-man8 install-sbinPROGRAMS install-strip installcheck \
435
-	installcheck-am installdirs maintainer-clean \
428
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
429
+	clean-sbinPROGRAMS distclean distclean-compile \
430
+	distclean-generic distclean-libtool distdir dvi dvi-am info \
431
+	info-am install install-am install-data install-data-am \
432
+	install-exec install-exec-am install-info install-info-am \
433
+	install-man install-man8 install-sbinPROGRAMS install-strip \
434
+	installcheck installcheck-am installdirs maintainer-clean \
436 435
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
437
-	mostlyclean-generic mostlyclean-libtool tags uninstall \
438
-	uninstall-am uninstall-info-am uninstall-man uninstall-man8 \
436
+	mostlyclean-generic mostlyclean-libtool uninstall uninstall-am \
437
+	uninstall-info-am uninstall-man uninstall-man8 \
439 438
 	uninstall-sbinPROGRAMS
440 439
 
440
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@    $(top_srcdir)/shared/cfgparser.c \
441
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@    $(top_srcdir)/shared/cfgparser.h \
442
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@    $(top_srcdir)/shared/getopt.c \
443
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@    $(top_srcdir)/shared/getopt.h \
444
+@BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@    clamav-milter.c
441 445
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
442 446
 # Otherwise a system limit (for SysV at least) may be exceeded.
443 447
 .NOEXPORT:
... ...
@@ -57,6 +57,8 @@
57 57
 void help(void);
58 58
 void daemonize(void);
59 59
 
60
+short debug_mode = 0, logok = 0;
61
+
60 62
 void clamd(struct optstruct *opt)
61 63
 {
62 64
 	struct cfgstruct *copt, *cpt;
... ...
@@ -89,8 +91,6 @@ void clamd(struct optstruct *opt)
89 89
 #endif
90 90
 	debug_mode = 1;
91 91
 
92
-    } else {
93
-	debug_mode = 0;
94 92
     }
95 93
 
96 94
     /* parse the config file */
... ...
@@ -110,18 +110,12 @@ void clamd(struct optstruct *opt)
110 110
 
111 111
     if(cfgopt(copt, "LogFileUnlock"))
112 112
 	logg_lock = 0;
113
-    else
114
-	logg_lock = 1;
115 113
 
116 114
     if(cfgopt(copt, "LogTime"))
117 115
 	logg_time = 1;
118
-    else
119
-	logg_time = 0;
120 116
 
121 117
     if(cfgopt(copt, "LogClean"))
122 118
 	logok = 1;
123
-    else
124
-	logok = 0;
125 119
 
126 120
     if((cpt = cfgopt(copt, "LogFileMaxSize")))
127 121
 	logg_size = cpt->numarg;
... ...
@@ -19,6 +19,6 @@
19 19
 #ifndef __SHARED_H
20 20
 #define __SHARED_H
21 21
 
22
-short debug_mode, logok;
22
+extern short debug_mode, logok;
23 23
 
24 24
 #endif
... ...
@@ -34,17 +34,8 @@
34 34
 #include "client.h"
35 35
 #include "output.h"
36 36
 
37
-
38 37
 void help(void);
39 38
 
40
-/* this local macro takes care about freeing memory at exit */
41
-/*
42
-#define mexit(i)    if(opt) free_opt(opt);			    \
43
-		    mprintf("*Memory freed. Exit code: %d\n", i);   \
44
-		    exit(i);
45
-*/
46
-#define mexit(i)    exit(i)
47
-
48 39
 void clamscan(struct optstruct *opt)
49 40
 {
50 41
 	int ds, dms, ret;
... ...
@@ -55,25 +46,20 @@ void clamscan(struct optstruct *opt)
55 55
 
56 56
     /* initialize some important variables */
57 57
 
58
-    mprintf_disabled = 0;
59
-
60 58
     if(optc(opt, 'v')) {
61 59
 	mprintf_verbose = 1;
62 60
 	logg_verbose = 1;
63
-    } else {
64
-	mprintf_verbose = 0;
65
-	logg_verbose = 0;
66 61
     }
67 62
 
68
-    if(optl(opt, "quiet")) mprintf_quiet = 1;
69
-    else mprintf_quiet = 0;
63
+    if(optl(opt, "quiet"))
64
+	mprintf_quiet = 1;
70 65
 
71
-    if(optl(opt, "stdout")) mprintf_stdout = 1;
72
-    else mprintf_stdout = 0;
66
+    if(optl(opt, "stdout"))
67
+	mprintf_stdout = 1;
73 68
 
74 69
     if(optc(opt, 'V')) {
75 70
 	mprintf("clamdscan / ClamAV version "VERSION"\n");
76
-	mexit(0);
71
+	exit(0);
77 72
     }
78 73
 
79 74
     if(optc(opt, 'h')) {
... ...
@@ -81,21 +67,16 @@ void clamscan(struct optstruct *opt)
81 81
     	help();
82 82
     }
83 83
 
84
-    if(optc(opt, 'i')) printinfected = 1;
85
-    else printinfected = 0;
84
+    if(optc(opt, 'i'))
85
+	printinfected = 1;
86 86
 
87 87
     /* initialize logger */
88 88
 
89
-    /* FIXME: enable in the future */
90
-    logg_size = 0;
91
-    logg_lock = 0;
92
-    logg_time = 0;
93
-
94 89
     if(optc(opt, 'l')) {
95 90
 	logg_file = getargc(opt, 'l');
96 91
 	if(logg("--------------------------------------\n")) {
97 92
 	    mprintf("!Problem with internal logger.\n");
98
-	    mexit(2);
93
+	    exit(2);
99 94
 	}
100 95
     } else 
101 96
 	logg_file = NULL;
... ...
@@ -125,7 +106,7 @@ void clamscan(struct optstruct *opt)
125 125
 	    logg("Time: %d.%3.3d sec (%d m %d s)\n", ds, dms/1000, ds/60, ds%60);
126 126
     }
127 127
 
128
-    mexit(ret);
128
+    exit(ret);
129 129
 }
130 130
 
131 131
 void help(void)
... ...
@@ -42,6 +42,9 @@
42 42
 
43 43
 void help(void);
44 44
 
45
+struct s_info claminfo;
46
+short recursion = 0, printinfected = 0, bell = 0;
47
+
45 48
 int clamscan(struct optstruct *opt)
46 49
 {
47 50
 	int ds, dms, ret;
... ...
@@ -53,21 +56,16 @@ int clamscan(struct optstruct *opt)
53 53
 
54 54
     /* initialize some important variables */
55 55
 
56
-    mprintf_disabled = 0;
57
-
58 56
     if(optc(opt, 'v')) {
59 57
 	mprintf_verbose = 1;
60 58
 	logg_verbose = 1;
61
-    } else {
62
-	mprintf_verbose = 0;
63
-	logg_verbose = 0;
64 59
     }
65 60
 
66
-    if(optl(opt, "quiet")) mprintf_quiet = 1;
67
-    else mprintf_quiet = 0;
61
+    if(optl(opt, "quiet"))
62
+	mprintf_quiet = 1;
68 63
 
69
-    if(optl(opt, "stdout")) mprintf_stdout = 1;
70
-    else mprintf_stdout = 0;
64
+    if(optl(opt, "stdout"))
65
+	mprintf_stdout = 1;
71 66
 
72 67
     if(optl(opt, "debug")) {
73 68
 #if defined(C_LINUX)
... ...
@@ -93,21 +91,17 @@ int clamscan(struct optstruct *opt)
93 93
 
94 94
     /* check other options */
95 95
 
96
-    if(optc(opt, 'r')) recursion = 1;
97
-    else recursion = 0;
96
+    if(optc(opt, 'r'))
97
+	recursion = 1;
98 98
 
99
-    if(optc(opt, 'i')) printinfected = 1;
100
-    else printinfected = 0;
99
+    if(optc(opt, 'i'))
100
+	printinfected = 1;
101 101
 
102
-    if(optl(opt, "bell")) bell = 1;
102
+    if(optl(opt, "bell"))
103
+	bell = 1;
103 104
 
104 105
     /* initialize logger */
105 106
 
106
-    /* FIXME: enable in the future */
107
-    logg_size = 0;
108
-    logg_lock = 0;
109
-    logg_time = 0;
110
-
111 107
     if(optc(opt, 'l')) {
112 108
 	logg_file = getargc(opt, 'l');
113 109
 	if(logg("--------------------------------------\n")) {
... ...
@@ -19,8 +19,6 @@
19 19
 #ifndef __SHARED_H
20 20
 #define __SHARED_H
21 21
 
22
-/* some global variables */
23
-
24 22
 struct s_info {
25 23
     int signs; /* number of signatures loaded */
26 24
     int dirs; /* number of scanned directories */
... ...
@@ -30,8 +28,9 @@ struct s_info {
30 30
     int notmoved; /* number of not moved files (if --move) */
31 31
     int errors; /*  ... of errors */
32 32
     long int blocks; /* number of read 16kb blocks */
33
-} claminfo;
33
+};
34 34
 
35
-short recursion, printinfected, bell;
35
+extern struct s_info claminfo;
36
+extern short recursion, printinfected, bell;
36 37
 
37 38
 #endif
... ...
@@ -162,45 +162,36 @@ int freshclam(struct optstruct *opt)
162 162
     if(optl(opt, "debug") || cfgopt(copt, "Debug"))
163 163
 	cl_debug();
164 164
 
165
-    mprintf_disabled = 0;
165
+    if(optc(opt, 'v'))
166
+	mprintf_verbose = 1;
166 167
 
167
-    if(optc(opt, 'v')) mprintf_verbose = 1;
168
-    else mprintf_verbose = 0;
168
+    if(optl(opt, "quiet"))
169
+	mprintf_quiet = 1;
169 170
 
170
-    if(optl(opt, "quiet")) mprintf_quiet = 1;
171
-    else mprintf_quiet = 0;
172
-
173
-    if(optl(opt, "stdout")) mprintf_stdout = 1;
174
-    else mprintf_stdout = 0;
171
+    if(optl(opt, "stdout"))
172
+	mprintf_stdout = 1;
175 173
 
176 174
     if(optc(opt, 'V')) {
177 175
 	mprintf("freshclam / ClamAV version "VERSION"\n");
178
-	mexit(0);
176
+	exit(0);
179 177
     }
180 178
 
181 179
     /* initialize logger */
182 180
 
183
-    /* FIXME: enable in config file */
184
-    logg_size = 0;
185
-    logg_lock = 0;
186
-    logg_time = 0;
187
-
188 181
     if(cfgopt(copt, "LogVerbose"))
189 182
 	logg_verbose = 1;
190
-    else
191
-	logg_verbose = 0;
192 183
 
193 184
     if(optc(opt, 'l')) {
194 185
 	logg_file = getargc(opt, 'l');
195 186
 	if(logg("--------------------------------------\n")) {
196 187
 	    mprintf("!Problem with internal logger.\n");
197
-	    mexit(1);
188
+	    exit(1);
198 189
 	}
199 190
     } else if((cpt = cfgopt(copt, "UpdateLogFile"))) {
200 191
 	logg_file = cpt->strarg; 
201 192
 	if(logg("--------------------------------------\n")) {
202 193
 	    mprintf("!Problem with internal logger.\n");
203
-	    mexit(1);
194
+	    exit(1);
204 195
 	}
205 196
     } else
206 197
 	logg_file = NULL;
... ...
@@ -210,8 +201,7 @@ int freshclam(struct optstruct *opt)
210 210
 	openlog("freshclam", LOG_PID, LOG_LOCAL6);
211 211
 	logg_syslog = 1;
212 212
 	syslog(LOG_INFO, "Freshclam started.\n");
213
-    } else
214
-	logg_syslog = 0;
213
+    }
215 214
 #endif
216 215
 
217 216
     /* change the current working directory */
... ...
@@ -248,7 +238,7 @@ int freshclam(struct optstruct *opt)
248 248
 
249 249
 	if(checks <= 0 || checks > 50) {
250 250
 	    mprintf("@Number of checks must be between 1 and 50.\n");
251
-	    mexit(41);
251
+	    exit(41);
252 252
 	}
253 253
 
254 254
 	bigsleep = 24 * 3600 / checks;
... ...
@@ -25,6 +25,4 @@ void help(void);
25 25
 void daemonize(void);
26 26
 int download(const struct cfgstruct *copt, const struct optstruct *opt);
27 27
 
28
-#define mexit(i)    exit(i)
29
-
30 28
 #endif
... ...
@@ -50,6 +50,16 @@ pthread_mutex_t logg_mutex = PTHREAD_MUTEX_INITIALIZER;
50 50
 
51 51
 FILE *logg_fd = NULL;
52 52
 
53
+short int logg_verbose = 0, logg_lock = 0, logg_time = 0;
54
+int logg_size = 0;
55
+const char *logg_file = NULL;
56
+#if defined(USE_SYSLOG) && !defined(C_AIX)
57
+short logg_syslog = 0;
58
+#endif
59
+
60
+short int mprintf_disabled = 0, mprintf_verbose = 0, mprintf_quiet = 0,
61
+	  mprintf_stdout = 0;
62
+
53 63
 int mdprintf(int desc, const char *str, ...)
54 64
 {
55 65
 	va_list args;
... ...
@@ -30,15 +30,15 @@ int mdprintf(int desc, const char *str, ...);
30 30
 
31 31
 int logg(const char *str, ...);
32 32
 void logg_close(void);
33
-short int logg_verbose, logg_lock, logg_time;
34
-int logg_size;
35
-const char *logg_file;
33
+extern short int logg_verbose, logg_lock, logg_time;
34
+extern int logg_size;
35
+extern const char *logg_file;
36 36
 
37 37
 #if defined(USE_SYSLOG) && !defined(C_AIX)
38
-short logg_syslog;
38
+extern short logg_syslog;
39 39
 #endif
40 40
 
41 41
 void mprintf(const char *str, ...);
42
-short int mprintf_disabled, mprintf_verbose, mprintf_quiet, mprintf_stdout;
42
+extern short int mprintf_disabled, mprintf_verbose, mprintf_quiet, mprintf_stdout;
43 43
 
44 44
 #endif