From a888503b4f247c27d131ed9727e255c0dc110eb1 Mon Sep 17 00:00:00 2001 From: dingrui Date: Mon, 6 Nov 2023 21:10:09 +0800 Subject: [PATCH] Remove unnecessary argument(tp) in gettimeofday() call for retrieving timezone (#12722) changes the `gettimeofday` caller, by removing an unused optional output argument. It would take 2 benefits: - simplify code, discard unnecessary arg. - possibly faster due to the implementation in kernel. --- src/util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index 26d92b922..17aabf648 100644 --- a/src/util.c +++ b/src/util.c @@ -993,10 +993,9 @@ long getTimeZone(void) { #if defined(__linux__) || defined(__sun) return timezone; #else - struct timeval tv; struct timezone tz; - gettimeofday(&tv, &tz); + gettimeofday(NULL, &tz); return tz.tz_minuteswest * 60L; #endif