Skip to content

Commit 188c524

Browse files
committed
minor code cleanup - replace useless struct timezone argument to gettimeofday with NULL in a few places, making it consistent with usage elsewhere.
1 parent 6aad07d commit 188c524

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
*
3838
*
3939
* IDENTIFICATION
40-
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.471 2005/10/20 20:05:44 tgl Exp $
40+
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.472 2005/10/22 14:27:28 adunstan Exp $
4141
*
4242
* NOTES
4343
*
@@ -1148,9 +1148,8 @@ ServerLoop(void)
11481148
last_touch_time;
11491149
struct timeval earlier,
11501150
later;
1151-
struct timezone tz;
11521151

1153-
gettimeofday(&earlier, &tz);
1152+
gettimeofday(&earlier, NULL);
11541153
last_touch_time = time(NULL);
11551154

11561155
nSockets = initMasks(&readmask);
@@ -1207,7 +1206,7 @@ ServerLoop(void)
12071206
*/
12081207
while (random_seed == 0)
12091208
{
1210-
gettimeofday(&later, &tz);
1209+
gettimeofday(&later, NULL);
12111210

12121211
/*
12131212
* We are not sure how much precision is in tv_usec, so we

src/backend/utils/adt/nabstime.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.145 2005/10/15 02:49:29 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.146 2005/10/22 14:27:29 adunstan Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1584,14 +1584,13 @@ Datum
15841584
timeofday(PG_FUNCTION_ARGS)
15851585
{
15861586
struct timeval tp;
1587-
struct timezone tpz;
15881587
char templ[128];
15891588
char buf[128];
15901589
text *result;
15911590
int len;
15921591
pg_time_t tt;
15931592

1594-
gettimeofday(&tp, &tpz);
1593+
gettimeofday(&tp, NULL);
15951594
tt = (pg_time_t) tp.tv_sec;
15961595
pg_strftime(templ, sizeof(templ), "%a %b %d %H:%M:%S.%%06d %Y %Z",
15971596
pg_localtime(&tt, global_timezone));

src/backend/utils/misc/pg_rusage.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/utils/misc/pg_rusage.c,v 1.2 2005/10/15 02:49:36 momjian Exp $
12+
* $PostgreSQL: pgsql/src/backend/utils/misc/pg_rusage.c,v 1.3 2005/10/22 14:27:29 adunstan Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -26,10 +26,8 @@
2626
void
2727
pg_rusage_init(PGRUsage *ru0)
2828
{
29-
struct timezone tz;
30-
3129
getrusage(RUSAGE_SELF, &ru0->ru);
32-
gettimeofday(&ru0->tv, &tz);
30+
gettimeofday(&ru0->tv, NULL);
3331
}
3432

3533
/*

0 commit comments

Comments
 (0)