summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorfilipe oliveira <filipecosta.90@gmail.com>2021-02-05 17:51:31 +0000
committerGitHub <noreply@github.com>2021-02-05 19:51:31 +0200
commitb3bdcd2278d1822d861d6e4c6b9688e6b0a33d37 (patch)
tree82ce79d4e4a48126e1a54ed40d7dc3720fcd84ee /tests
parent18ac41973b87c444ed07ff6c043f38e59414b008 (diff)
downloadredis-b3bdcd2278d1822d861d6e4c6b9688e6b0a33d37.tar.gz
Fix compiler warning on implicit declaration of ‘nanosleep’ . Removed unused variable (#8454)
Diffstat (limited to 'tests')
-rw-r--r--tests/modules/blockonbackground.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/modules/blockonbackground.c b/tests/modules/blockonbackground.c
index cf7e9c7c1..fcabfa4d2 100644
--- a/tests/modules/blockonbackground.c
+++ b/tests/modules/blockonbackground.c
@@ -1,4 +1,5 @@
#define REDISMODULE_EXPERIMENTAL_API
+#define _XOPEN_SOURCE 700
#include "redismodule.h"
#include <stdio.h>
#include <stdlib.h>
@@ -55,7 +56,7 @@ void *BlockDebug_ThreadMain(void *arg) {
}
/* The thread entry point that actually executes the blocking part
- * of the command BLOCK.DEBUG. */
+ * of the command BLOCK.DOUBLE_DEBUG. */
void *DoubleBlock_ThreadMain(void *arg) {
void **targ = arg;
RedisModuleBlockedClient *bc = targ[0];
@@ -173,14 +174,13 @@ int HelloBlockNoTracking_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **a
int HelloDoubleBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
if (argc != 2) return RedisModule_WrongArity(ctx);
long long delay;
- long long timeout;
if (RedisModule_StringToLongLong(argv[1],&delay) != REDISMODULE_OK) {
return RedisModule_ReplyWithError(ctx,"ERR invalid count");
}
pthread_t tid;
- RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx,HelloBlock_Reply,HelloBlock_Timeout,HelloBlock_FreeData,timeout);
+ RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx,HelloBlock_Reply,HelloBlock_Timeout,HelloBlock_FreeData,0);
/* Now that we setup a blocking client, we need to pass the control
* to the thread. However we need to pass arguments to the thread: