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

Commita7bcf39

Browse files
committed
Remove useless lstat() call in pg_rewind.
This is duplicative of an lstat that was just done by the callingfunction (traverse_datadir), besides which we weren't really doinganything with the results. There's not much point in checking tosee if someone removed the file since the previous lstat, since theFILE_ACTION_REMOVE code would have to deal with missing-file casesanyway. Moreover, the "exists = false" assignment was a dead store;nothing was done with that value later.A syscall saved is a syscall earned, so back-patch to 9.5where this code was introduced.Discussion:https://postgr.es/m/1221796.1599329320@sss.pgh.pa.us
1 parentfc37c6f commita7bcf39

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

‎src/bin/pg_rewind/filemap.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,6 @@ process_target_file(const char *path, file_type_t type, size_t oldsize,
342342
constchar*link_target)
343343
{
344344
boolexists;
345-
charlocalpath[MAXPGPATH];
346-
structstatstatbuf;
347345
file_entry_tkey;
348346
file_entry_t*key_ptr;
349347
filemap_t*map=filemap;
@@ -355,16 +353,6 @@ process_target_file(const char *path, file_type_t type, size_t oldsize,
355353
* the source data folder when processing the source files.
356354
*/
357355

358-
snprintf(localpath,sizeof(localpath),"%s/%s",datadir_target,path);
359-
if (lstat(localpath,&statbuf)<0)
360-
{
361-
if (errno!=ENOENT)
362-
pg_fatal("could not stat file \"%s\": %m",
363-
localpath);
364-
365-
exists= false;
366-
}
367-
368356
if (map->array==NULL)
369357
{
370358
/* on first call, initialize lookup array */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp