summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-01-13 18:03:12 +0000
committerRoy Marples <roy@marples.name>2009-01-13 18:03:12 +0000
commitbd487e6c771dac18b2a2b8b62c5127b09f57b002 (patch)
tree166260de8caa886f71995c285400abe476505114 /dhcpcd.c
parentf6ec8e1146094000d1418246be2a1576b57b99f9 (diff)
downloaddhcpcd-bd487e6c771dac18b2a2b8b62c5127b09f57b002.tar.xz
Send version length first on the control socket.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 61b9d5dc..f9e120cf 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1115,7 +1115,12 @@ handle_args(struct fd_list *fd, int argc, char **argv)
if (fd != NULL) {
/* Special commands for our control socket */
if (strcmp(*argv, "--version") == 0) {
- write(fd->fd, VERSION, strlen(VERSION));
+ l = strlen(VERSION);
+ iov[0].iov_base = &l;
+ iov[0].iov_len = sizeof(ssize_t);
+ iov[1].iov_base = UNCONST(VERSION);
+ iov[1].iov_len = l;
+ writev(fd->fd, iov, 2);
return 0;
} else if (strcmp(*argv, "--getinterfaces") == 0) {
l = 0;