From: antirez Date: Wed, 29 Apr 2009 08:33:29 +0000 (+0200) Subject: Check for fork() failure in background saving X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/5a7c647e9acb6034e2bfbe879b1cba4209a76c05?ds=inline Check for fork() failure in background saving --- diff --git a/redis.c b/redis.c index 1237a048..c120b9db 100644 --- a/redis.c +++ b/redis.c @@ -1879,6 +1879,11 @@ static int rdbSaveBackground(char *filename) { } } else { /* 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); server.bgsaveinprogress = 1; return REDIS_OK;