X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fmemcached_io.c;h=c74e2cdf4adc75e0a2808def9e8c189e62655b31;hb=070f9452d0e14086ef7b6cf6fef4bf109f7d2cc5;hp=6e517144cb966358a4a0f8be55a80b84e9c6dc19;hpb=35a37b8f10e31646efb89325331c171ecae87d78;p=m6w6%2Flibmemcached diff --git a/libmemcached/memcached_io.c b/libmemcached/memcached_io.c index 6e517144..c74e2cdf 100644 --- a/libmemcached/memcached_io.c +++ b/libmemcached/memcached_io.c @@ -18,15 +18,14 @@ static void increment_udp_message_id(memcached_server_st *ptr); static memcached_return io_wait(memcached_server_st *ptr, memc_read_or_write read_or_write) { - struct pollfd fds[1]= { - [0].fd= ptr->fd, - [0].events = POLLIN + struct pollfd fds= { + .fd= ptr->fd, + .events = POLLIN }; - short flags= 0; int error; unlikely (read_or_write == MEM_WRITE) /* write */ - fds[0].events= POLLOUT; + fds.events= POLLOUT; /* ** We are going to block on write, but at least on Solaris we might block @@ -44,10 +43,10 @@ static memcached_return io_wait(memcached_server_st *ptr, } int timeout= ptr->root->poll_timeout; - if ((ptr->root->flags & MEM_NO_BLOCK) == 0) + if (ptr->root->flags.no_block == false) timeout= -1; - error= poll(fds, 1, timeout); + error= poll(&fds, 1, timeout); if (error == 1) return MEMCACHED_SUCCESS; @@ -113,7 +112,7 @@ static bool process_input_buffer(memcached_server_st *ptr) ** We might be able to process some of the response messages if we ** have a callback set up */ - if (ptr->root->callbacks != NULL && (ptr->root->flags & MEM_USE_UDP) == 0) + if (ptr->root->callbacks != NULL && ptr->root->flags.use_udp == false) { /* * We might have responses... try to read them out and fire @@ -127,7 +126,7 @@ static bool process_input_buffer(memcached_server_st *ptr) &ptr->root->result); if (error == MEMCACHED_SUCCESS) { - for (int x= 0; x < cb.number_of_callback; x++) + for (unsigned int x= 0; x < cb.number_of_callback; x++) { error= (*cb.callback[x])(ptr->root, &ptr->root->result, cb.context); if (error != MEMCACHED_SUCCESS)