Avoid assuming that the fields of struct timeval have exactly type long.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 May 2007 18:54:10 +0000 (18:54 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 24 May 2007 18:54:10 +0000 (18:54 +0000)
This is probably incorrect on some platforms, and definitely draws a
compiler warning on Darwin.

contrib/pgbench/pgbench.c

index 68527a77eb242c980f743850435e895635990ca3..001b51936609691c71863702124bd4d5a8850fd8 100644 (file)
@@ -476,7 +476,8 @@ top:
                                (int) (now.tv_usec - st->txn_begin.tv_usec);
 
                        fprintf(LOGFILE, "%d %d %.0f %d %ld %ld\n",
-                               st->id, st->cnt, diff, st->use_file, now.tv_sec,now.tv_usec);
+                                       st->id, st->cnt, diff, st->use_file,
+                                       (long) now.tv_sec, (long) now.tv_usec);
                }
 
                if (commands[st->state]->type == SQL_COMMAND)