11/*
2- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.43 2005/10/1502:49:06 momjian Exp $
2+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.44 2005/10/1520:24:00 tgl Exp $
33 *
44 * pgbench: a simple benchmark program for PostgreSQL
55 * written by Tatsuo Ishii
@@ -260,12 +260,14 @@ compareVariables(const void *v1, const void *v2)
260260static char *
261261getVariable (CState * st ,char * name )
262262{
263- Variable key = {name },* var ;
263+ Variable key ,
264+ * var ;
264265
265266/* On some versions of Solaris, bsearch of zero items dumps core */
266267if (st -> nvariables <=0 )
267268return NULL ;
268269
270+ key .name = name ;
269271var = (Variable * )bsearch ((void * )& key ,
270272 (void * )st -> variables ,
271273st -> nvariables ,
@@ -280,8 +282,10 @@ getVariable(CState * st, char *name)
280282static int
281283putVariable (CState * st ,char * name ,char * value )
282284{
283- Variable key = {name },* var ;
285+ Variable key ,
286+ * var ;
284287
288+ key .name = name ;
285289/* On some versions of Solaris, bsearch of zero items dumps core */
286290if (st -> nvariables > 0 )
287291var = (Variable * )bsearch ((void * )& key ,
@@ -1093,11 +1097,10 @@ main(int argc, char **argv)
10931097#if !(defined(__CYGWIN__ )|| defined(__MINGW32__ ))
10941098#ifdef RLIMIT_NOFILE /* most platform uses RLIMIT_NOFILE */
10951099if (getrlimit (RLIMIT_NOFILE ,& rlim )== -1 )
1096- {
10971100#else /* but BSD doesn't ... */
10981101if (getrlimit (RLIMIT_OFILE ,& rlim )== -1 )
1102+ #endif /* RLIMIT_NOFILE */
10991103{
1100- #endif /* HAVE_RLIMIT_NOFILE */
11011104fprintf (stderr ,"getrlimit failed. reason: %s\n" ,strerror (errno ));
11021105exit (1 );
11031106}
@@ -1107,8 +1110,7 @@ main(int argc, char **argv)
11071110fprintf (stderr ,"Use limit/ulimt to increase the limit before using pgbench.\n" );
11081111exit (1 );
11091112}
1110- #endif /* #if !(defined(__CYGWIN__) ||
1111- * defined(__MINGW32__)) */
1113+ #endif /* #if !(defined(__CYGWIN__) || defined(__MINGW32__)) */
11121114break ;
11131115case 'C' :
11141116is_connect = 1 ;