diff options
author | Joe Hu <jowhuw@amazon.com> | 2023-04-17 14:05:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 21:05:36 +0300 |
commit | 644d94558a739656f81343f3b8a12205d53eeeb7 (patch) | |
tree | 50e88486643de035ed887f6dcc27fb0e5498245c /src/anet.h | |
parent | e7f18432b8e9e1d1998d3a898006497e6c5e5a32 (diff) | |
download | redis-644d94558a739656f81343f3b8a12205d53eeeb7.tar.gz |
Fix RDB check regression caused by PR 12022 (#12051)
The nightly tests showed that the recent PR #12022 caused random failures
in aof.tcl on checking RDB preamble inside an AOF file.
Root cause:
When checking RDB preamble in an AOF file, what's passed into redis_check_rdb is
aof_filename, not aof_filepath. The newly introduced isFifo function does not check return
status of the stat call and hence uses the uninitailized stat_p object.
Fix:
1. Fix isFifo by checking stat call's return code.
2. Pass aof_filepath instead of aof_filename to redis_check_rdb.
3. move the FIFO check to rdb.c since the limitation is the re-opening of the file, and not
anything specific about redis-check-rdb.
Diffstat (limited to 'src/anet.h')
-rw-r--r-- | src/anet.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/anet.h b/src/anet.h index b571e52c1..b13c14f77 100644 --- a/src/anet.h +++ b/src/anet.h @@ -70,5 +70,6 @@ int anetFormatAddr(char *fmt, size_t fmt_len, char *ip, int port); int anetPipe(int fds[2], int read_flags, int write_flags); int anetSetSockMarkId(char *err, int fd, uint32_t id); int anetGetError(int fd); +int anetIsFifo(char *filepath); #endif |