Skip to content

Commit 5e8900a

Browse files
committed
use redisFD type
1 parent 4c8e732 commit 5e8900a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void send_client_tracking(redisContext *c, const char *str) {
176176
freeReplyObject(reply);
177177
}
178178

179-
static int disconnect(redisContext *c, int keep_fd) {
179+
static redisFD disconnect(redisContext *c, int keep_fd) {
180180
redisReply *reply;
181181

182182
/* Make sure we're on DB 9. */
@@ -189,9 +189,9 @@ static int disconnect(redisContext *c, int keep_fd) {
189189

190190
/* Free the context as well, but keep the fd if requested. */
191191
if (keep_fd)
192-
return redisFreeKeepFd(c);
192+
return (int)redisFreeKeepFd(c);
193193
redisFree(c);
194-
return -1;
194+
return REDIS_INVALID_FD;
195195
}
196196

197197
static void do_ssl_handshake(redisContext *c) {
@@ -220,8 +220,8 @@ static redisContext *do_connect(struct config config) {
220220
/* Create a dummy connection just to get an fd to inherit */
221221
redisContext *dummy_ctx = redisConnectUnix(config.unix_sock.path);
222222
if (dummy_ctx) {
223-
int fd = disconnect(dummy_ctx, 1);
224-
printf("Connecting to inherited fd %d\n", fd);
223+
redisFD fd = disconnect(dummy_ctx, 1);
224+
printf("Connecting to inherited fd %d\n", (int)fd);
225225
c = redisConnectFd(fd);
226226
}
227227
} else {

0 commit comments

Comments
 (0)