1
1
/*
2
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.43 2005/10/15 02:49:06 momjian Exp $
2
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.44 2005/10/15 20:24:00 tgl Exp $
3
3
*
4
4
* pgbench: a simple benchmark program for PostgreSQL
5
5
* written by Tatsuo Ishii
@@ -260,12 +260,14 @@ compareVariables(const void *v1, const void *v2)
260
260
static char *
261
261
getVariable (CState * st , char * name )
262
262
{
263
- Variable key = {name }, * var ;
263
+ Variable key ,
264
+ * var ;
264
265
265
266
/* On some versions of Solaris, bsearch of zero items dumps core */
266
267
if (st -> nvariables <= 0 )
267
268
return NULL ;
268
269
270
+ key .name = name ;
269
271
var = (Variable * ) bsearch ((void * ) & key ,
270
272
(void * ) st -> variables ,
271
273
st -> nvariables ,
@@ -280,8 +282,10 @@ getVariable(CState * st, char *name)
280
282
static int
281
283
putVariable (CState * st , char * name , char * value )
282
284
{
283
- Variable key = {name }, * var ;
285
+ Variable key ,
286
+ * var ;
284
287
288
+ key .name = name ;
285
289
/* On some versions of Solaris, bsearch of zero items dumps core */
286
290
if (st -> nvariables > 0 )
287
291
var = (Variable * ) bsearch ((void * ) & key ,
@@ -1093,11 +1097,10 @@ main(int argc, char **argv)
1093
1097
#if !(defined(__CYGWIN__ ) || defined(__MINGW32__ ))
1094
1098
#ifdef RLIMIT_NOFILE /* most platform uses RLIMIT_NOFILE */
1095
1099
if (getrlimit (RLIMIT_NOFILE , & rlim ) == -1 )
1096
- {
1097
1100
#else /* but BSD doesn't ... */
1098
1101
if (getrlimit (RLIMIT_OFILE , & rlim ) == -1 )
1102
+ #endif /* RLIMIT_NOFILE */
1099
1103
{
1100
- #endif /* HAVE_RLIMIT_NOFILE */
1101
1104
fprintf (stderr , "getrlimit failed. reason: %s\n" , strerror (errno ));
1102
1105
exit (1 );
1103
1106
}
@@ -1107,8 +1110,7 @@ main(int argc, char **argv)
1107
1110
fprintf (stderr , "Use limit/ulimt to increase the limit before using pgbench.\n" );
1108
1111
exit (1 );
1109
1112
}
1110
- #endif /* #if !(defined(__CYGWIN__) ||
1111
- * defined(__MINGW32__)) */
1113
+ #endif /* #if !(defined(__CYGWIN__) || defined(__MINGW32__)) */
1112
1114
break ;
1113
1115
case 'C' :
1114
1116
is_connect = 1 ;
0 commit comments