summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-04-14 10:17:27 +0100
committerRoy Marples <roy@marples.name>2017-04-14 10:17:27 +0100
commit5b3c46078bfc06d2a14f29dc5b5bf482adf2d52e (patch)
tree1986f44ccd2b6edfd9a12fa9efe1e2ccdce50f50 /compat
parent7085ee9a8d8462a7bc65a938042cc6ed0dacf61e (diff)
downloaddhcpcd-5b3c46078bfc06d2a14f29dc5b5bf482adf2d52e.tar.xz
dprintf should append, not truncate.
Diffstat (limited to 'compat')
-rw-r--r--compat/dprintf.c5
-rw-r--r--compat/dprintf.h2
2 files changed, 3 insertions, 4 deletions
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 <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;
}
-
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 <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