summaryrefslogtreecommitdiff
path: root/src/os_posix/os_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_posix/os_time.c')
-rw-r--r--src/os_posix/os_time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/os_posix/os_time.c b/src/os_posix/os_time.c
index c7ae881af97..719e214696b 100644
--- a/src/os_posix/os_time.c
+++ b/src/os_posix/os_time.c
@@ -17,6 +17,15 @@ __wt_epoch(WT_SESSION_IMPL *session, struct timespec *tsp)
{
WT_DECL_RET;
+ /*
+ * This function doesn't return an error, but panics on failure (which
+ * should never happen, it's done this way to simplify error handling
+ * in the caller). However, some compilers complain about using garbage
+ * values. Initializing the values avoids the complaint.
+ */
+ tsp->tv_sec = 0;
+ tsp->tv_nsec = 0;
+
#if defined(HAVE_CLOCK_GETTIME)
WT_SYSCALL_RETRY(clock_gettime(CLOCK_REALTIME, tsp), ret);
if (ret == 0)