Page MenuHomeFreeBSD

D41358.id125882.diff
No OneTemporary

D41358.id125882.diff

diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -2405,7 +2405,7 @@
}
static void
-readconfigfile(FILE *cf, int allow_includes)
+parseconfigfile(FILE *cf, bool allow_includes)
{
FILE *cf2;
struct filed *f;
@@ -2466,7 +2466,7 @@
if (cf2 == NULL)
continue;
dprintf("reading %s\n", file);
- readconfigfile(cf2, 0);
+ parseconfigfile(cf2, false);
fclose(cf2);
}
free(ent);
@@ -2542,6 +2542,28 @@
}
}
+static void
+readconfigfile(const char *path)
+{
+ FILE *cf;
+ struct filed *f;
+
+ if ((cf = fopen(path, "r")) != NULL) {
+ parseconfigfile(cf, true);
+ (void)fclose(cf);
+ } else {
+ dprintf("cannot open %s\n", ConfFile);
+ f = cfline("*.ERR\t/dev/console", "*", "*", "*");
+ if (f != NULL)
+ addfile(f);
+ free(f);
+ f = cfline("*.PANIC\t*", "*", "*", "*");
+ if (f != NULL)
+ addfile(f);
+ free(f);
+ }
+}
+
static void
sighandler(int signo)
{
@@ -2557,7 +2579,6 @@
init(int signo)
{
int i;
- FILE *cf;
struct filed *f;
char *p;
char oldLocalHostName[MAXHOSTNAMELEN];
@@ -2648,27 +2669,7 @@
free(f);
}
- /* open the configuration file */
- if ((cf = fopen(ConfFile, "r")) == NULL) {
- dprintf("cannot open %s\n", ConfFile);
- f = cfline("*.ERR\t/dev/console", "*", "*", "*");
- if (f != NULL)
- addfile(f);
- free(f);
- f = cfline("*.PANIC\t*", "*", "*", "*");
- if (f != NULL)
- addfile(f);
- free(f);
- Initialized = 1;
-
- return;
- }
-
- readconfigfile(cf, 1);
-
- /* close the configuration file */
- (void)fclose(cf);
-
+ readconfigfile(ConfFile);
Initialized = 1;
if (Debug) {

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 3:25 AM (18 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14526589
Default Alt Text
D41358.id125882.diff (1 KB)

Event Timeline