From 48ceb915031799f5d5bdb4e0b83386efaa5943bf Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Mon, 1 Sep 2003 11:06:05 +0000 Subject: * svlogd.c: barf if all log directories given at the command line fail. * man/svlogd.8: adapt. 0.11.1. --- src/svlogd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/svlogd.c') diff --git a/src/svlogd.c b/src/svlogd.c index 4c44b48..1e9498f 100644 --- a/src/svlogd.c +++ b/src/svlogd.c @@ -80,6 +80,7 @@ unsigned int dirn =0; void usage() { strerr_die4x(111, "usage: ", progname, USAGE, "\n"); } void die_nomem() { strerr_die2x(111, FATAL, "out of memory."); } void fatal(char *m0) { strerr_die3sys(111, FATAL, m0, ": "); } +void fatalx(char *m0) { strerr_die2x(111, FATAL, m0); } void fatal2(char *m0, char *m1) { strerr_die5sys(111, FATAL, m0, ": ", m1, ": "); } @@ -396,11 +397,13 @@ unsigned int logdir_open(struct logdir *ld, const char *fn) { void logdirs_reopen(void) { int l; + int ok =0; for (l =0; l < dirn; ++l) { logdir_close(&dir[l]); - logdir_open(&dir[l], fndir[l]); + if (logdir_open(&dir[l], fndir[l])) ok =1; } + if (! ok) fatalx("no functional log directories."); } unsigned int linestart(struct logdir *ld, char *s, int len) { -- cgit 1.4.1