r874 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Aug 21 19:49:39 CEST 2006


Author: phk
Date: 2006-08-21 19:49:39 +0200 (Mon, 21 Aug 2006)
New Revision: 874

Modified:
   trunk/varnish-cache/bin/varnishd/tcp.c
Log:
Bandaid until Dag Erling does what's necessary


Modified: trunk/varnish-cache/bin/varnishd/tcp.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/tcp.c	2006-08-21 17:32:41 UTC (rev 873)
+++ trunk/varnish-cache/bin/varnishd/tcp.c	2006-08-21 17:49:39 UTC (rev 874)
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <netdb.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -74,6 +75,19 @@
 }
 #endif
 
+static char *
+strndup(const char *p, unsigned n)
+{
+	char *q;
+
+	q = malloc(n + 1);
+	if (q != NULL) {
+		memcpy(q, p, n);
+		q[n] = '\0';
+	}
+	return (q);
+}
+
 int
 TCP_parse(const char *str, char **addr, char **port)
 {




More information about the varnish-commit mailing list