diff options
-rw-r--r-- | src/anet.c | 4 | ||||
-rw-r--r-- | src/dict.c | 3 | ||||
-rw-r--r-- | src/geo.c | 2 | ||||
-rw-r--r-- | src/quicklist.h | 2 | ||||
-rw-r--r-- | src/redis-cli.c | 9 |
5 files changed, 11 insertions, 9 deletions
diff --git a/src/anet.c b/src/anet.c index b65301243..bde460fc8 100644 --- a/src/anet.c +++ b/src/anet.c @@ -529,11 +529,11 @@ static int anetGenericAccept(char *err, int s, struct sockaddr *sa, socklen_t *l /* Accept a connection and also make sure the socket is non-blocking, and CLOEXEC. * returns the new socket FD, or -1 on error. */ -int anetTcpAccept(char *err, int s, char *ip, size_t ip_len, int *port) { +int anetTcpAccept(char *err, int serversock, char *ip, size_t ip_len, int *port) { int fd; struct sockaddr_storage sa; socklen_t salen = sizeof(sa); - if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == ANET_ERR) + if ((fd = anetGenericAccept(err,serversock,(struct sockaddr*)&sa,&salen)) == ANET_ERR) return ANET_ERR; if (sa.ss_family == AF_INET) { diff --git a/src/dict.c b/src/dict.c index 1420055e7..9d96c6c27 100644 --- a/src/dict.c +++ b/src/dict.c @@ -1154,8 +1154,7 @@ size_t _dictGetStatsHt(char *buf, size_t bufsize, dict *d, int htidx) { if (clvector[i] == 0) continue; if (l >= bufsize) break; l += snprintf(buf+l,bufsize-l, - " %s%ld: %ld (%.02f%%)\n", - (i == DICT_STATS_VECTLEN-1)?">= ":"", + " %ld: %ld (%.02f%%)\n", i, clvector[i], ((float)clvector[i]/DICTHT_SIZE(d->ht_size_exp[htidx]))*100); } @@ -444,7 +444,7 @@ void geoaddCommand(client *c) { char *opt = c->argv[longidx]->ptr; if (!strcasecmp(opt,"nx")) nx = 1; else if (!strcasecmp(opt,"xx")) xx = 1; - else if (!strcasecmp(opt,"ch")) {} + else if (!strcasecmp(opt,"ch")) { /* Handle in zaddCommand. */ } else break; longidx++; } diff --git a/src/quicklist.h b/src/quicklist.h index 14c53ca4c..04136a733 100644 --- a/src/quicklist.h +++ b/src/quicklist.h @@ -107,7 +107,7 @@ typedef struct quicklist { quicklistNode *tail; unsigned long count; /* total count of all entries in all listpacks */ unsigned long len; /* number of quicklistNodes */ - int fill : QL_FILL_BITS; /* fill factor for individual nodes */ + unsigned int fill : QL_FILL_BITS; /* fill factor for individual nodes */ unsigned int compress : QL_COMP_BITS; /* depth of end nodes not to compress;0=off */ unsigned int bookmark_count: QL_BM_BITS; quicklistBookmark bookmarks[]; diff --git a/src/redis-cli.c b/src/redis-cli.c index 950e591f1..c826a93f0 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -7904,8 +7904,11 @@ static void statMode(void) { int j; reply = reconnectingRedisCommand(context,"INFO"); - if (reply->type == REDIS_REPLY_ERROR) { - printf("ERROR: %s\n", reply->str); + if (reply == NULL) { + fprintf(stderr, "\nI/O error\n"); + exit(1); + } else if (reply->type == REDIS_REPLY_ERROR) { + fprintf(stderr, "ERROR: %s\n", reply->str); exit(1); } @@ -8071,7 +8074,7 @@ static void LRUTestMode(void) { if (redisGetReply(context, (void**)&reply) == REDIS_OK) { switch(reply->type) { case REDIS_REPLY_ERROR: - printf("%s\n", reply->str); + fprintf(stderr, "%s\n", reply->str); break; case REDIS_REPLY_NIL: misses++; |