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

Commit477e5bc

Browse files
authored
Some minor fixes (#397)
* Reformat fio_*() definitions for easier grep'ping* typo* move check_postmaster() into src/utils/file.c (from src/util.c), rename it to local_check_postmaster() and make it static/private to src/utils/file.c
1 parent47c3993 commit477e5bc

File tree

5 files changed

+174
-117
lines changed

5 files changed

+174
-117
lines changed

‎src/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ validate_one_page(Page page, BlockNumber absolute_blkno,
15161516
}
15171517

15181518
/*
1519-
*Valiate pages of datafile in PGDATA one by one.
1519+
*Validate pages of datafile in PGDATA one by one.
15201520
*
15211521
* returns true if the file is valid
15221522
* also returns true if the file was not found

‎src/pg_probackup.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,6 @@ extern PageState *get_checksum_map(const char *fullpath, uint32 checksum_version
10711071
intn_blocks,XLogRecPtrdest_stop_lsn,BlockNumbersegmentno);
10721072
externdatapagemap_t*get_lsn_map(constchar*fullpath,uint32checksum_version,
10731073
intn_blocks,XLogRecPtrshift_lsn,BlockNumbersegmentno);
1074-
externpid_tcheck_postmaster(constchar*pgdata);
1075-
10761074
externboolvalidate_file_pages(pgFile*file,constchar*fullpath,XLogRecPtrstop_lsn,
10771075
uint32checksum_version,uint32backup_version,HeaderMap*hdr_map);
10781076

‎src/util.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -556,51 +556,3 @@ datapagemap_print_debug(datapagemap_t *map)
556556

557557
pg_free(iter);
558558
}
559-
560-
/*
561-
* Return pid of postmaster process running in given pgdata.
562-
* Return 0 if there is none.
563-
* Return 1 if postmaster.pid is mangled.
564-
*/
565-
pid_t
566-
check_postmaster(constchar*pgdata)
567-
{
568-
FILE*fp;
569-
pid_tpid;
570-
charpid_file[MAXPGPATH];
571-
572-
join_path_components(pid_file,pgdata,"postmaster.pid");
573-
574-
fp=fopen(pid_file,"r");
575-
if (fp==NULL)
576-
{
577-
/* No pid file, acceptable*/
578-
if (errno==ENOENT)
579-
return0;
580-
else
581-
elog(ERROR,"Cannot open file \"%s\": %s",
582-
pid_file,strerror(errno));
583-
}
584-
585-
if (fscanf(fp,"%i",&pid)!=1)
586-
{
587-
/* something is wrong with the file content */
588-
pid=1;
589-
}
590-
591-
if (pid>1)
592-
{
593-
if (kill(pid,0)!=0)
594-
{
595-
/* process no longer exists */
596-
if (errno==ESRCH)
597-
pid=0;
598-
else
599-
elog(ERROR,"Failed to send signal 0 to a process %d: %s",
600-
pid,strerror(errno));
601-
}
602-
}
603-
604-
fclose(fp);
605-
returnpid;
606-
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp