Skip to content

Commit 1d4bd77

Browse files
committed
vacuumdb: Don't assign negative values to a boolean.
Since a179232 (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
1 parent 6c772c7 commit 1d4bd77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/bin/scripts/vacuumdb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
339339
ParallelSlot *slots = NULL;
340340
SimpleStringList dbtables = {NULL, NULL};
341341
int i;
342-
bool result = 0;
342+
bool failed = false;
343343
bool parallel = concurrentCons > 1;
344344
const char *stage_commands[] = {
345345
"SET default_statistics_target=1; SET vacuum_cost_delay=0;",
@@ -457,7 +457,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
457457

458458
if (CancelRequested)
459459
{
460-
result = -1;
460+
failed = true;
461461
goto finish;
462462
}
463463

@@ -476,7 +476,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
476476
free_slot = GetIdleSlot(slots, concurrentCons, dbname, progname);
477477
if (!free_slot)
478478
{
479-
result = -1;
479+
failed = true;
480480
goto finish;
481481
}
482482

@@ -518,7 +518,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts,
518518

519519
termPQExpBuffer(&sql);
520520

521-
if (result == -1)
521+
if (failed)
522522
exit(1);
523523
}
524524

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy