c->error is no longer a redisReply object, but rather a plain C-string
This commit is contained in:
parent
97920b443e
commit
1a5f111d52
@ -11,7 +11,7 @@ int main(void) {
|
|||||||
|
|
||||||
c = redisConnect((char*)"127.0.0.1", 6379, NULL);
|
c = redisConnect((char*)"127.0.0.1", 6379, NULL);
|
||||||
if (c->error != NULL) {
|
if (c->error != NULL) {
|
||||||
printf("Connection error: %s", ((redisReply*)c->error)->reply);
|
printf("Connection error: %s", c->error);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
test.c
9
test.c
@ -16,10 +16,11 @@ static long long usec(void) {
|
|||||||
return (((long long)tv.tv_sec)*1000000)+tv.tv_usec;
|
return (((long long)tv.tv_sec)*1000000)+tv.tv_usec;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __connect(redisContext **c) {
|
static void __connect(redisContext **target) {
|
||||||
*c = redisConnect((char*)"127.0.0.1", 6379, NULL);
|
redisContext *c;
|
||||||
if ((*c)->error != NULL) {
|
c = *target = redisConnect((char*)"127.0.0.1", 6379, NULL);
|
||||||
printf("Connection error: %s", ((redisReply*)(*c)->error)->reply);
|
if (c->error != NULL) {
|
||||||
|
printf("Connection error: %s", c->error);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user