diff options
author | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 16:48:19 +0200 |
---|---|---|
committer | Pieter Noordhuis <pcnoordhuis@gmail.com> | 2010-10-19 16:48:19 +0200 |
commit | 206868de060bbfeb2745dad2f410691ad2fc62f8 (patch) | |
tree | 1ed9f586266ee7297460c4df6b650d2127bc84bb /extra/hiredis | |
parent | ba42ab2ef8fcf9bf88c0d68414d24c3bb00e00c8 (diff) |
Make error callback argument const
Diffstat (limited to 'extra/hiredis')
-rw-r--r-- | extra/hiredis/libevent.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extra/hiredis/libevent.h b/extra/hiredis/libevent.h index 63d6663..46b5503 100644 --- a/extra/hiredis/libevent.h +++ b/extra/hiredis/libevent.h @@ -3,7 +3,7 @@ #include <hiredis.h> /* Prototype for the error callback. */ -typedef void (redisErrorCallback)(redisContext*); +typedef void (redisErrorCallback)(const redisContext*); /* This struct enables us to pass both the events and the * redisContext to the read and write handlers. */ @@ -73,11 +73,12 @@ void redisLibEventOnFree(redisContext *c, void *privdata) { free(e); } -redisContext *redisLibEventConnect(const char *ip, int port, redisErrorCallback *err, struct event_base *base) { +redisContext *redisLibEventConnect(struct event_base *base, redisErrorCallback *err, const char *ip, int port) { redisEvents *e; redisContext *c = redisConnectNonBlock(ip, port, NULL); if (c->error != NULL) { err(c); + redisFree(c); return NULL; } |