summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
authorvenaas <venaas>2007-06-22 11:03:57 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2007-06-22 11:03:57 +0000
commit5858558fb347bb5e0d68473099ebe06b0dc327b5 (patch)
treecf5a2cedd0b7df8b011b8908dcff2672ccf64016 /debug.c
parent71fab9c3e4b7f71148081249321f9509d997a334 (diff)
segfault when logging that couldn't open log file fixed, now log to stderr
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.0@150 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/debug.c b/debug.c
index 51ea91f..384c141 100644
--- a/debug.c
+++ b/debug.c
@@ -62,9 +62,11 @@ int debug_set_destination(char *dest) {
if (!strncasecmp(dest, "file:///", 8)) {
debug_file = fopen(dest + 7, "a");
- if (!debug_file)
+ if (!debug_file) {
+ debug_file = stderr;
debugx(1, DBG_ERR, "Failed to open logfile %s\n%s",
dest + 7, strerror(errno));
+ }
setvbuf(debug_file, NULL, _IONBF, 0);
return 1;
}