aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2015-08-12 16:49:36 +0200
committerAndres Freund <andres@anarazel.de>2015-08-15 16:54:10 +0200
commit32951f9aa9acfd4b6318f6daf39c3d1c10a264ba (patch)
tree4c9d9ea4b6976ebaed866954ec1ff1414b0d17e5 /src
parentd19c1b0b24d53f41222bf808dc6b40404b2954a1 (diff)
downloadpostgresql-32951f9aa9acfd4b6318f6daf39c3d1c10a264ba.tar.gz
postgresql-32951f9aa9acfd4b6318f6daf39c3d1c10a264ba.zip
vacuumdb: Don't assign negative values to a boolean.
Since a17923204736 (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
Diffstat (limited to 'src')
-rw-r--r--src/bin/scripts/vacuumdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index 7e72db1edf7..f0dc6a7bd5d 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -339,7 +339,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
ParallelSlot *slots = NULL;
SimpleStringList dbtables = {NULL, NULL};
int i;
- bool result = 0;
+ bool failed = false;
bool parallel = concurrentCons > 1;
const char *stage_commands[] = {
"SET default_statistics_target=1; SET vacuum_cost_delay=0;",
@@ -457,7 +457,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
if (CancelRequested)
{
- result = -1;
+ failed = true;
goto finish;
}
@@ -476,7 +476,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
free_slot = GetIdleSlot(slots, concurrentCons, dbname, progname);
if (!free_slot)
{
- result = -1;
+ failed = true;
goto finish;
}
@@ -518,7 +518,7 @@ finish:
termPQExpBuffer(&sql);
- if (result == -1)
+ if (failed)
exit(1);
}