From 206868de060bbfeb2745dad2f410691ad2fc62f8 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 19 Oct 2010 16:48:19 +0200 Subject: Make error callback argument const --- extra/hiredis/libevent.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'extra/hiredis') 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 /* 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; } -- cgit v1.2.3