Fixes needed to compile with musl C library

Patch originally by Codarren Velvindron
This commit is contained in:
Monty 2016-02-07 15:00:30 +02:00
commit d80b8442a6
7 changed files with 18 additions and 9 deletions

View file

@ -348,7 +348,7 @@ grn_com_event_add(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
e.events = (__uint32_t) events;
e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_ADD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;
@ -396,7 +396,7 @@ grn_com_event_mod(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
struct epoll_event e;
memset(&e, 0, sizeof(struct epoll_event));
e.data.fd = (fd);
e.events = (__uint32_t) events;
e.events = (uint32_t) events;
if (epoll_ctl(ev->epfd, EPOLL_CTL_MOD, (fd), &e) == -1) {
SERR("epoll_ctl");
return ctx->rc;

View file

@ -83,7 +83,11 @@ GRN_API grn_com_queue_entry *grn_com_queue_deque(grn_ctx *ctx, grn_com_queue *q)
# define GRN_COM_POLLIN EVFILT_READ
# define GRN_COM_POLLOUT EVFILT_WRITE
# else /* USE_KQUEUE */
# include <sys/poll.h>
# if defined(HAVE_POLL_H)
# include <poll.h>
# elif defined(HAVE_SYS_POLL_H)
# include <sys/poll.h>
# endif /* defined(HAVE_POLL_H) */
# define GRN_COM_POLLIN POLLIN
# define GRN_COM_POLLOUT POLLOUT
# endif /* USE_KQUEUE */