Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32951f9

Browse files
committed
vacuumdb: Don't assign negative values to a boolean.
Sincea179232 (vacuumdb: enable parallel mode) -1 has been assignedto a boolean. That can, justifiedly, trigger compiler warnings. There'salso no need for ternary logic, result was only ever set to 0 or -1. Sodon't.Discussion: 20150812084351.GD8470@awork2.anarazel.deBackpatch: 9.5
1 parentd19c1b0 commit32951f9

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
SimpleStringListdbtables= {NULL,NULL};
341341
inti;
342-
boolresult=0;
342+
boolfailed=false;
343343
boolparallel=concurrentCons>1;
344344
constchar*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
gotofinish;
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
gotofinish;
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)

[8]ページ先頭

©2009-2025 Movatter.jp