From: Roy Marples Date: Fri, 14 Apr 2017 09:17:27 +0000 (+0100) Subject: dprintf should append, not truncate. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b3c46078bfc06d2a14f29dc5b5bf482adf2d52e;p=thirdparty%2Fdhcpcd.git dprintf should append, not truncate. --- diff --git a/compat/dprintf.c b/compat/dprintf.c index 610a8f0b..2ef81ade 100644 --- a/compat/dprintf.c +++ b/compat/dprintf.c @@ -1,6 +1,6 @@ /* * dhcpcd - DHCP client daemon - * Copyright (c) 2006-2014 Roy Marples + * Copyright (c) 2006-2017 Roy Marples * 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; } - diff --git a/compat/dprintf.h b/compat/dprintf.h index b8cd4971..9defbcb8 100644 --- a/compat/dprintf.h +++ b/compat/dprintf.h @@ -1,6 +1,6 @@ /* * dhcpcd - DHCP client daemon - * Copyright (c) 2006-2014 Roy Marples + * Copyright (c) 2006-2017 Roy Marples * All rights reserved * Redistribution and use in source and binary forms, with or without