[master] b3d6add Make TIM_parse() return double like all other TIM_ functions.

Poul-Henning Kamp phk at varnish-cache.org
Sun Oct 9 19:47:34 CEST 2011


commit b3d6addcbabd1885f7150c6fb45800a2bcbb339b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 9 17:46:57 2011 +0000

    Make TIM_parse() return double like all other TIM_ functions.
    
    Eliminate libvarnish.h embedded #includes.

diff --git a/bin/varnishd/cache_pool.c b/bin/varnishd/cache_pool.c
index c5183a4..0380b55 100644
--- a/bin/varnishd/cache_pool.c
+++ b/bin/varnishd/cache_pool.c
@@ -58,6 +58,8 @@
 #ifndef CLOCK_MONOTONIC
 #define CLOCK_MONOTONIC	0
 
+#include <sys/time.h>
+
 static int
 clock_gettime(int foo, struct timespec *ts)
 {
diff --git a/bin/varnishd/mgt_sandbox_solaris.c b/bin/varnishd/mgt_sandbox_solaris.c
index 2c975d9..3b6182f 100644
--- a/bin/varnishd/mgt_sandbox_solaris.c
+++ b/bin/varnishd/mgt_sandbox_solaris.c
@@ -36,6 +36,7 @@
 
 #include <stdio.h>
 #include <syslog.h>
+#include <strin.h>
 
 #ifdef HAVE_PRIV_H
 #include <priv.h>
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index bbaa366..d010a73 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -69,6 +69,7 @@
 #include <string.h>
 #include <strings.h>
 #include <unistd.h>
+#include <time.h>
 
 #include "compat/daemon.h"
 
diff --git a/include/libvarnish.h b/include/libvarnish.h
index 157a64e..b016848 100644
--- a/include/libvarnish.h
+++ b/include/libvarnish.h
@@ -28,10 +28,7 @@
  *
  */
 
-#include <errno.h>
-#include <time.h>
 #include <stdint.h>
-#include <sys/types.h>
 
 #include "vas.h"
 
@@ -88,7 +85,7 @@ void VTCP_set_read_timeout(int s, double seconds);
 /* from libvarnish/time.c */
 #define TIM_FORMAT_SIZE 30
 void TIM_format(double t, char *p);
-time_t TIM_parse(const char *p);
+double TIM_parse(const char *p);
 double TIM_mono(void);
 double TIM_real(void);
 void TIM_sleep(double t);
diff --git a/lib/libvarnish/cli_serve.c b/lib/libvarnish/cli_serve.c
index 854c2ff..b7c52f4 100644
--- a/lib/libvarnish/cli_serve.c
+++ b/lib/libvarnish/cli_serve.c
@@ -36,6 +36,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <time.h>
 #include <unistd.h>
 
 #include "vqueue.h"
diff --git a/lib/libvarnish/time.c b/lib/libvarnish/time.c
index 8242853..31fc284 100644
--- a/lib/libvarnish/time.c
+++ b/lib/libvarnish/time.c
@@ -116,10 +116,10 @@ static const char *fmts[] = {
 	NULL
 };
 
-time_t
+double
 TIM_parse(const char *p)
 {
-	time_t t;
+	double t;
 	struct tm tm;
 	const char **r;
 
diff --git a/lib/libvarnish/vmb.c b/lib/libvarnish/vmb.c
index 7464bbe..2c004ce 100644
--- a/lib/libvarnish/vmb.c
+++ b/lib/libvarnish/vmb.c
@@ -27,6 +27,7 @@
  */
 
 #include <pthread.h>
+#include <unistd.h>
 #include "libvarnish.h"
 #include "vmb.h"
 



More information about the varnish-commit mailing list