Commit 5a7c647e authored by antirez's avatar antirez
Browse files

Check for fork() failure in background saving

parent 3a2694c4
...@@ -1879,6 +1879,11 @@ static int rdbSaveBackground(char *filename) { ...@@ -1879,6 +1879,11 @@ static int rdbSaveBackground(char *filename) {
} }
} else { } else {
/* Parent */ /* Parent */
if (childpid == -1) {
redisLog(REDIS_WARNING,"Can't save in background: fork: %s",
strerror(errno));
return REDIS_ERR;
}
redisLog(REDIS_NOTICE,"Background saving started by pid %d",childpid); redisLog(REDIS_NOTICE,"Background saving started by pid %d",childpid);
server.bgsaveinprogress = 1; server.bgsaveinprogress = 1;
return REDIS_OK; return REDIS_OK;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment