From: Roy Marples Date: Tue, 13 Jan 2009 18:03:12 +0000 (+0000) Subject: Send version length first on the control socket. X-Git-Tag: v5.0.0~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd487e6c771dac18b2a2b8b62c5127b09f57b002;p=thirdparty%2Fdhcpcd.git Send version length first on the control socket. --- 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;