X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/021321e0efc0fcc54645ee9016a229257e1d4ba7..7551f2a0b19e5cf444bf6fed3b8ed5b2c936a228:/deps/hiredis/example-libev.c?ds=inline diff --git a/deps/hiredis/example-libev.c b/deps/hiredis/example-libev.c index 8efa1e39..7894f1f4 100644 --- a/deps/hiredis/example-libev.c +++ b/deps/hiredis/example-libev.c @@ -15,16 +15,20 @@ void getCallback(redisAsyncContext *c, void *r, void *privdata) { redisAsyncDisconnect(c); } -void connectCallback(const redisAsyncContext *c) { - ((void)c); - printf("connected...\n"); +void connectCallback(const redisAsyncContext *c, int status) { + if (status != REDIS_OK) { + printf("Error: %s\n", c->errstr); + return; + } + printf("Connected...\n"); } void disconnectCallback(const redisAsyncContext *c, int status) { if (status != REDIS_OK) { printf("Error: %s\n", c->errstr); + return; } - printf("disconnected...\n"); + printf("Disconnected...\n"); } int main (int argc, char **argv) {