summaryrefslogtreecommitdiff
path: root/debug.c
diff options
context:
space:
mode:
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;
}