]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dprintf should append, not truncate.
authorRoy Marples <roy@marples.name>
Fri, 14 Apr 2017 09:17:27 +0000 (10:17 +0100)
committerRoy Marples <roy@marples.name>
Fri, 14 Apr 2017 09:17:27 +0000 (10:17 +0100)
compat/dprintf.c
compat/dprintf.h

index 610a8f0b9fca7c69e11cdf5eae88bb2c8c0dce79..2ef81ade814b00a1632c7685b4420fae96a67084 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * dhcpcd - DHCP client daemon
- * Copyright (c) 2006-2014 Roy Marples <roy@marples.name>
+ * Copyright (c) 2006-2017 Roy Marples <roy@marples.name>
  * All rights reserved
 
  * Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,7 @@ vdprintf(int fd, const char * __restrict fmt, va_list va)
        if ((e = dup(fd)) == -1)
                return -1;
 
-       if ((fp = fdopen(e, "w")) == NULL) {
+       if ((fp = fdopen(e, "a")) == NULL) {
                close(e);
                return -1;
        }
@@ -62,4 +62,3 @@ dprintf(int fd, const char * __restrict fmt, ...)
        va_end(va);
        return e;
 }
-
index b8cd49717486a4c9524c02f56d68766a1fcfa395..9defbcb835ff1152ec7fefae0b57aa54e91777a0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * dhcpcd - DHCP client daemon
- * Copyright (c) 2006-2014 Roy Marples <roy@marples.name>
+ * Copyright (c) 2006-2017 Roy Marples <roy@marples.name>
  * All rights reserved
 
  * Redistribution and use in source and binary forms, with or without