From 5858558fb347bb5e0d68473099ebe06b0dc327b5 Mon Sep 17 00:00:00 2001 From: venaas Date: Fri, 22 Jun 2007 11:03:57 +0000 Subject: 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 --- debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debug.c') 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; } -- cgit v1.1