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.
This commit is contained in:
dingrui 2023-11-06 21:10:09 +08:00 committed by GitHub
parent 282b82e9d2
commit a888503b4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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