Userland: Stop passing ignored timezones to gettimeofday

This commit is contained in:
Nico Weber 2020-08-27 17:00:00 -04:00 committed by Andreas Kling
parent ab87d42200
commit 88319b188e
Notes: sideshowbarker 2024-07-19 03:05:00 +09:00
3 changed files with 8 additions and 11 deletions

View file

@ -58,7 +58,6 @@ static bool in_ci = false;
static struct timeval start_time {
0, 0
};
static struct timezone tz;
static bool g_some_test_failed = false;
static bool encrypting = true;
@ -476,18 +475,18 @@ auto main(int argc, char** argv) -> int
return 1;
}
#define I_TEST(thing) \
{ \
printf("Testing " #thing "... "); \
fflush(stdout); \
gettimeofday(&start_time, &tz); \
#define I_TEST(thing) \
{ \
printf("Testing " #thing "... "); \
fflush(stdout); \
gettimeofday(&start_time, nullptr); \
}
#define PASS \
{ \
struct timeval end_time { \
0, 0 \
}; \
gettimeofday(&end_time, &tz); \
gettimeofday(&end_time, nullptr); \
time_t interval_s = end_time.tv_sec - start_time.tv_sec; \
suseconds_t interval_us = end_time.tv_usec; \
if (interval_us < start_time.tv_usec) { \

View file

@ -163,8 +163,7 @@ static void handle_sigabrt(int)
static double get_time_in_ms()
{
struct timeval tv1;
struct timezone tz1;
auto return_code = gettimeofday(&tv1, &tz1);
auto return_code = gettimeofday(&tv1, nullptr);
ASSERT(return_code >= 0);
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
}

View file

@ -183,8 +183,7 @@ static void handle_sigabrt(int)
static double get_time_in_ms()
{
struct timeval tv1;
struct timezone tz1;
auto return_code = gettimeofday(&tv1, &tz1);
auto return_code = gettimeofday(&tv1, nullptr);
ASSERT(return_code >= 0);
return static_cast<double>(tv1.tv_sec) * 1000.0 + static_cast<double>(tv1.tv_usec) / 1000.0;
}