Skip to content

Commit a868e24

Browse files
committed
Avoid assuming that the fields of struct timeval have exactly type long.
This is probably incorrect on some platforms, and definitely draws a compiler warning on Darwin.
1 parent 4e3cb9c commit a868e24

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/pgbench/pgbench.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.65 2007/04/08 01:15:07 ishii Exp $
2+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.66 2007/05/24 18:54:10 tgl Exp $
33
*
44
* pgbench: a simple benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -476,7 +476,8 @@ doCustom(CState * state, int n, int debug)
476476
(int) (now.tv_usec - st->txn_begin.tv_usec);
477477

478478
fprintf(LOGFILE, "%d %d %.0f %d %ld %ld\n",
479-
st->id, st->cnt, diff, st->use_file, now.tv_sec,now.tv_usec);
479+
st->id, st->cnt, diff, st->use_file,
480+
(long) now.tv_sec, (long) now.tv_usec);
480481
}
481482

482483
if (commands[st->state]->type == SQL_COMMAND)

0 commit comments

Comments
 (0)