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

Commitd06bc61

Browse files
committed
Fix access to uninitalized variables in GCC
1 parent51b2168 commitd06bc61

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

‎src/backend/storage/file/cfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,8 @@ static bool cfs_gc_file(char* map_path)
559559
close(md2);
560560
md2=-1;
561561
newSize=pg_atomic_read_u32(&newMap->usedSize);
562+
virtSize=pg_atomic_read_u32(&newMap->virtSize);
563+
n_pages=virtSize /BLCKSZ;
562564
remove_backups= false;
563565
gotoReplaceMap;
564566
}

‎src/backend/storage/smgr/md.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,12 +502,15 @@ mdunlinkfork(RelFileNodeBackend rnode, ForkNumber forkNum, bool isRedo)
502502
if (md_use_compression(rnode,forkNum))
503503
{
504504
Filefile=PathNameOpenFile(path,O_RDWR |PG_BINARY |PG_COMPRESSION,0);
505+
ret=-1;
505506
if (file >=0) {
506507
elog(LOG,"Truncate file %s",path);
507508
if (FileTruncate(file,0)<0) {
508509
ereport(WARNING,
509510
(errcode_for_file_access(),
510511
errmsg("could not truncate file \"%s\": %m",path)));
512+
}else {
513+
ret=0;
511514
}
512515
}
513516
FileClose(file);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp