changeset 5453:fef58462dea6 draft

logerr: Don't leak the logfile stream to scripts
author Roy Marples <roy@marples.name>
date Sat, 12 Sep 2020 15:58:03 +0100
parents a351afa57787
children 68ef863871d1
files src/logerr.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/logerr.c	Fri Sep 11 15:07:19 2020 +0100
+++ b/src/logerr.c	Sat Sep 12 15:58:03 2020 +0100
@@ -382,7 +382,7 @@
 	}
 
 #ifndef SMALL
-	if ((ctx->log_file = fopen(path, "a")) == NULL)
+	if ((ctx->log_file = fopen(path, "ae")) == NULL)
 		return -1;
 	setlinebuf(ctx->log_file);
 	return fileno(ctx->log_file);