redismodule.h: Check ModuleNameBusy before calling it

Older versions might not have this function.
This commit is contained in:
Mark Nunberg 2018-01-23 10:49:18 -05:00 committed by GitHub
parent 727dd43614
commit 062bd733da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -374,7 +374,7 @@ static int RedisModule_Init(RedisModuleCtx *ctx, const char *name, int ver, int
REDISMODULE_GET_API(AbortBlock); REDISMODULE_GET_API(AbortBlock);
#endif #endif
if (RedisModule_IsModuleNameBusy(name)) return REDISMODULE_ERR; if (RedisModule_IsModuleNameBusy && RedisModule_IsModuleNameBusy(name)) return REDISMODULE_ERR;
RedisModule_SetModuleAttribs(ctx,name,ver,apiver); RedisModule_SetModuleAttribs(ctx,name,ver,apiver);
return REDISMODULE_OK; return REDISMODULE_OK;
} }