Skip to content

Commit 40785ad

Browse files
committed
Fix checking of stat() return code
1 parent 25e8421 commit 40785ad

File tree

1 file changed

+2
-2
lines changed
  • src/backend/storage/file

1 file changed

+2
-2
lines changed

src/backend/storage/file/fd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3955,7 +3955,7 @@ sfs_snapshot_file_size(const char *fname, bool isdir, int elevel)
39553955
&& snap_id == sfs_current_snapshot)
39563956
{
39573957
struct stat fst;
3958-
if (!stat(fname, &fst))
3958+
if (stat(fname, &fst))
39593959
elog(elevel, "[SFS] Failed to stat snapshot file %s: %m", fname);
39603960
sfs_snapshot_size += fst.st_size;
39613961
}
@@ -3988,7 +3988,7 @@ sfs_snapshot_file_time(const char *fname, bool isdir, int elevel)
39883988
&& snap_id == sfs_current_snapshot)
39893989
{
39903990
struct stat fst;
3991-
if (!stat(fname, &fst))
3991+
if (stat(fname, &fst))
39923992
elog(elevel, "[SFS] Failed to stat snapshot file %s: %m", fname);
39933993
if (sfs_snapshot_time > (uint64)fst.st_ctime) {
39943994
sfs_snapshot_time = fst.st_ctime;

0 commit comments

Comments
 (0)