]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
logerr: Don't leak the logfile stream to scripts
authorRoy Marples <roy@marples.name>
Sat, 12 Sep 2020 14:58:03 +0000 (15:58 +0100)
committerRoy Marples <roy@marples.name>
Sat, 12 Sep 2020 14:58:03 +0000 (15:58 +0100)
src/logerr.c

index 817c53ca4d1bd76868f96e7e00e2b02594273b5f..5fba91d33c58a365117f45a1edc41724d1838e78 100644 (file)
@@ -382,7 +382,7 @@ logopen(const char *path)
        }
 
 #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);