summary refs log tree commit diff
path: root/src/svlogd.c
diff options
context:
space:
mode:
authorGerrit Pape <pape@smarden.org>2003-09-01 11:06:05 +0000
committerGerrit Pape <pape@smarden.org>2003-09-01 11:06:05 +0000
commit48ceb915031799f5d5bdb4e0b83386efaa5943bf (patch)
tree45988d0dc1cff06aba3c418ac182e47636e4e2ea /src/svlogd.c
parent27201625fb99184e94c82513040ad52ee2b84972 (diff)
downloadrunit-48ceb915031799f5d5bdb4e0b83386efaa5943bf.tar.gz
runit-48ceb915031799f5d5bdb4e0b83386efaa5943bf.tar.xz
runit-48ceb915031799f5d5bdb4e0b83386efaa5943bf.zip
* svlogd.c: barf if all log directories given at the command line fail.
  * man/svlogd.8: adapt.
0.11.1.
Diffstat (limited to 'src/svlogd.c')
-rw-r--r--src/svlogd.c5
1 files changed, 4 insertions, 1 deletions
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) {