vacuumdb: Don't assign negative values to a boolean.

Since a179232047 (vacuumdb: enable parallel mode) -1 has been assigned
to a boolean. That can, justifiedly, trigger compiler warnings. There's
also no need for ternary logic, result was only ever set to 0 or -1. So
don't.

Discussion: 20150812084351.GD8470@awork2.anarazel.de
Backpatch: 9.5
This commit is contained in:
Andres Freund 2015-08-12 16:49:36 +02:00
parent 6c772c7453
commit 1d4bd77568
1 changed files with 4 additions and 4 deletions

View File

@ -339,7 +339,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
ParallelSlot *slots = NULL; ParallelSlot *slots = NULL;
SimpleStringList dbtables = {NULL, NULL}; SimpleStringList dbtables = {NULL, NULL};
int i; int i;
bool result = 0; bool failed = false;
bool parallel = concurrentCons > 1; bool parallel = concurrentCons > 1;
const char *stage_commands[] = { const char *stage_commands[] = {
"SET default_statistics_target=1; SET vacuum_cost_delay=0;", "SET default_statistics_target=1; SET vacuum_cost_delay=0;",
@ -457,7 +457,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
if (CancelRequested) if (CancelRequested)
{ {
result = -1; failed = true;
goto finish; goto finish;
} }
@ -476,7 +476,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
free_slot = GetIdleSlot(slots, concurrentCons, dbname, progname); free_slot = GetIdleSlot(slots, concurrentCons, dbname, progname);
if (!free_slot) if (!free_slot)
{ {
result = -1; failed = true;
goto finish; goto finish;
} }
@ -518,7 +518,7 @@ finish:
termPQExpBuffer(&sql); termPQExpBuffer(&sql);
if (result == -1) if (failed)
exit(1); exit(1);
} }