summaryrefslogtreecommitdiff
path: root/tests/server/util.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2007-02-17 01:25:32 +0000
committerDan Fandrich <dan@coneharvesters.com>2007-02-17 01:25:32 +0000
commit213017e9cfea983a8b8e38c1a591e77dd2ecb85e (patch)
tree8b1a401b66ccc2b7bb074d7833d5bee02d5db09f /tests/server/util.c
parent69f2f5cb6fbf9b5ba4f811888fc0ec1e5a7c4567 (diff)
downloadcurl-213017e9cfea983a8b8e38c1a591e77dd2ecb85e.tar.gz
Remove C99isms
Diffstat (limited to 'tests/server/util.c')
-rw-r--r--tests/server/util.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/tests/server/util.c b/tests/server/util.c
index d3d976c13..7db611597 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -27,8 +27,6 @@
#include <string.h>
#include <stdarg.h>
#include <signal.h>
-#include <time.h>
-#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_UNISTD_H
@@ -54,6 +52,7 @@
#include "curlx.h" /* from the private lib dir */
#include "getpart.h"
#include "util.h"
+#include "timeval.h"
#if defined(ENABLE_IPV6) && defined(__MINGW32__)
const struct in6_addr in6addr_any = {{ IN6ADDR_ANY_INIT }};
@@ -68,18 +67,20 @@ void logmsg(const char *msg, ...)
char buffer[512]; /* possible overflow if you pass in a huge string */
FILE *logfp;
int error;
+ struct timeval tv;
+ time_t sec;
+ struct tm *now;
+ char timebuf[20];
if (!serverlogfile) {
fprintf(stderr, "Error: serverlogfile not set\n");
return;
}
- struct timeval tv = curlx_tvnow();
- time_t sec = tv.tv_sec;
- struct tm *now =
- localtime(&sec); /* not multithread safe but we don't care */
+ tv = curlx_tvnow();
+ sec = tv.tv_sec;
+ now = localtime(&sec); /* not multithread safe but we don't care */
- char timebuf[20];
snprintf(timebuf, sizeof(timebuf), "%02d:%02d:%02d.%06ld",
now->tm_hour, now->tm_min, now->tm_sec, tv.tv_usec);