add a check for aeCreateTimeEvent

1) Add a check for aeCreateTimeEvent in function initServer.
This commit is contained in:
Stam He 2013-02-27 18:00:47 +08:00 committed by antirez
parent 9c8be6cab9
commit e431a97660

View File

@ -1399,7 +1399,10 @@ void initServer() {
server.unixtime = time(NULL);
server.lastbgsave_status = REDIS_OK;
server.stop_writes_on_bgsave_err = 1;
aeCreateTimeEvent(server.el, 1, serverCron, NULL, NULL);
if(aeCreateTimeEvent(server.el, 1, serverCron, NULL, NULL) == AE_ERR) {
redisPanic("create time event failed");
exit(1);
}
if (server.ipfd > 0 && aeCreateFileEvent(server.el,server.ipfd,AE_READABLE,
acceptTcpHandler,NULL) == AE_ERR) redisPanic("Unrecoverable error creating server.ipfd file event.");
if (server.sofd > 0 && aeCreateFileEvent(server.el,server.sofd,AE_READABLE,