Properly reset errno for rdbLoad (#7542)

This commit is contained in:
Madelyn Olson 2020-07-21 17:00:13 -07:00 committed by GitHub
parent 36b9494385
commit 818dc3a089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4881,6 +4881,7 @@ void loadDataFromDisk(void) {
serverLog(LL_NOTICE,"DB loaded from append only file: %.3f seconds",(float)(ustime()-start)/1000000);
} else {
rdbSaveInfo rsi = RDB_SAVE_INFO_INIT;
errno = 0; /* Prevent a stale value from affecting error checking */
if (rdbLoad(server.rdb_filename,&rsi,RDBFLAGS_NONE) == C_OK) {
serverLog(LL_NOTICE,"DB loaded from disk: %.3f seconds",
(float)(ustime()-start)/1000000);