mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Add error log message when failing to open RDB file for reading (#11036)
When failing to open the rdb file, there was no specific error printed (unlike a corrupt file), so it was not clear what failed and why.
This commit is contained in:
@@ -3254,7 +3254,11 @@ int rdbLoad(char *filename, rdbSaveInfo *rsi, int rdbflags) {
|
||||
int retval;
|
||||
struct stat sb;
|
||||
|
||||
if ((fp = fopen(filename,"r")) == NULL) return C_ERR;
|
||||
fp = fopen(filename, "r");
|
||||
if (fp == NULL) {
|
||||
serverLog(LL_WARNING,"Fatal error: can't open the RDB file %s for reading: %s", filename, strerror(errno));
|
||||
return C_ERR;
|
||||
}
|
||||
|
||||
if (fstat(fileno(fp), &sb) == -1)
|
||||
sb.st_size = 0;
|
||||
|
||||
Reference in New Issue
Block a user