From f0807923a3565c5fe42992b3fa7e54e38cdd2221 Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Tue, 18 Feb 2014 15:33:56 +0100 Subject: [PATCH] fix: gettimeofday() expects two arguments --- dbutils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dbutils.c b/dbutils.c index d0669ba5..ee704f36 100644 --- a/dbutils.c +++ b/dbutils.c @@ -19,6 +19,7 @@ #include #include +#include #include "repmgr.h" #include "strutil.h" @@ -433,6 +434,7 @@ wait_connection_availability(PGconn *conn, unsigned long timeout) fd_set read_set; int sock = PQsocket(conn); struct timeval tmout, before, after; + struct timezone tz; /* recalc to microseconds */ timeout *= 1000000; @@ -463,7 +465,7 @@ wait_connection_availability(PGconn *conn, unsigned long timeout) FD_ZERO(&read_set); FD_SET(sock, &read_set); - gettimeofday(&before); + gettimeofday(&before, &tz); if (select(sock, &read_set, NULL, NULL, &tmout) == -1) { log_warning( @@ -471,7 +473,7 @@ wait_connection_availability(PGconn *conn, unsigned long timeout) strerror(errno)); return -1; } - gettimeofday(&after); + gettimeofday(&after, &tz); timeout -= (after.tv_sec * 1000000 + after.tv_usec) - (before.tv_sec * 1000000 + before.tv_usec);