mirror of
https://github.com/fluencelabs/redis
synced 2025-06-01 11:31:20 +00:00
Abort when opening the RDB file results in an error other than ENOENT.
This fixes cases where the RDB file does exist but can't be accessed for any reason. For instance, when the Redis process doesn't have enough permissions on the file.
This commit is contained in:
parent
18d16f8592
commit
b9f8c2a5b0
@ -1069,7 +1069,6 @@ int rdbLoad(char *filename) {
|
||||
|
||||
fp = fopen(filename,"r");
|
||||
if (!fp) {
|
||||
errno = ENOENT;
|
||||
return REDIS_ERR;
|
||||
}
|
||||
rioInitWithFile(&rdb,fp);
|
||||
|
@ -2603,7 +2603,7 @@ void loadDataFromDisk(void) {
|
||||
redisLog(REDIS_NOTICE,"DB loaded from disk: %.3f seconds",
|
||||
(float)(ustime()-start)/1000000);
|
||||
} else if (errno != ENOENT) {
|
||||
redisLog(REDIS_WARNING,"Fatal error loading the DB. Exiting.");
|
||||
redisLog(REDIS_WARNING,"Fatal error loading the DB: %s. Exiting.",strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user