changeset 2471:4b8bdeacc5a2 draft

Fix writing interfaces to control socket.
author Roy Marples <roy@marples.name>
date Sun, 04 May 2014 22:48:43 +0000
parents f8409fb98913
children bf549b4eec69
files dhcpcd.c script.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/dhcpcd.c	Sat May 03 21:18:20 2014 +0000
+++ b/dhcpcd.c	Sun May 04 22:48:43 2014 +0000
@@ -998,8 +998,8 @@
 					if (ipv6nd_has_ra(ifp))
 						len++;
 				}
-				if (write(fd->fd, &len, sizeof(len) !=
-				    sizeof(len)))
+				if (write(fd->fd, &len, sizeof(len)) !=
+				    sizeof(len))
 					return -1;
 				TAILQ_FOREACH(ifp, ctx->ifaces, next) {
 					if (send_interface(fd->fd, ifp) == -1)
--- a/script.c	Sat May 03 21:18:20 2014 +0000
+++ b/script.c	Sun May 04 22:48:43 2014 +0000
@@ -506,7 +506,7 @@
 	if ((ssize_t)elen == -1)
 		return -1;
 	iov[0].iov_base = &elen;
-	iov[0].iov_len = sizeof(ssize_t);
+	iov[0].iov_len = sizeof(elen);
 	iov[1].iov_base = s;
 	iov[1].iov_len = elen;
 	retval = writev(fd, iov, 2);