mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Remove warning.
This commit is contained in:
parent
7c25a43adc
commit
59bd44d1c8
36
src/t_list.c
36
src/t_list.c
@ -818,6 +818,24 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int checkTimeout(redisClient *c, robj *object, time_t *timeout) {
|
||||||
|
long long lltimeout;
|
||||||
|
|
||||||
|
if (getLongLongFromObject(object, &lltimeout) != REDIS_OK) {
|
||||||
|
addReplyError(c, "timeout is not an integer");
|
||||||
|
return REDIS_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lltimeout < 0) {
|
||||||
|
addReplyError(c, "timeout is negative");
|
||||||
|
return REDIS_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
|
*timeout = lltimeout;
|
||||||
|
|
||||||
|
return REDIS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* Blocking RPOP/LPOP */
|
/* Blocking RPOP/LPOP */
|
||||||
void blockingPopGenericCommand(redisClient *c, int where) {
|
void blockingPopGenericCommand(redisClient *c, int where) {
|
||||||
robj *o;
|
robj *o;
|
||||||
@ -881,24 +899,6 @@ void blockingPopGenericCommand(redisClient *c, int where) {
|
|||||||
blockForKeys(c, c->argv + 1, c->argc - 2, timeout, NULL);
|
blockForKeys(c, c->argv + 1, c->argc - 2, timeout, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
int checkTimeout(redisClient *c, robj *object, time_t *timeout) {
|
|
||||||
long long lltimeout;
|
|
||||||
|
|
||||||
if (getLongLongFromObject(object, &lltimeout) != REDIS_OK) {
|
|
||||||
addReplyError(c, "timeout is not an integer");
|
|
||||||
return REDIS_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lltimeout < 0) {
|
|
||||||
addReplyError(c, "timeout is negative");
|
|
||||||
return REDIS_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
*timeout = lltimeout;
|
|
||||||
|
|
||||||
return REDIS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void blpopCommand(redisClient *c) {
|
void blpopCommand(redisClient *c) {
|
||||||
blockingPopGenericCommand(c,REDIS_HEAD);
|
blockingPopGenericCommand(c,REDIS_HEAD);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user