Skip to content

Commit d80b844

Browse files
committed
Fixes needed to compile with musl C library
Patch originally by Codarren Velvindron
1 parent 07b8aef commit d80b844

File tree

7 files changed

+18
-9
lines changed

7 files changed

+18
-9
lines changed

configure.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ CHECK_INCLUDE_FILES (netinet/in.h HAVE_NETINET_IN_H)
199199
CHECK_INCLUDE_FILES (paths.h HAVE_PATHS_H)
200200
CHECK_INCLUDE_FILES (port.h HAVE_PORT_H)
201201
CHECK_INCLUDE_FILES (poll.h HAVE_POLL_H)
202+
CHECK_INCLUDE_FILES (sys/poll.h HAVE_SYS_POLL_H)
202203
CHECK_INCLUDE_FILES (pwd.h HAVE_PWD_H)
203204
CHECK_INCLUDE_FILES (sched.h HAVE_SCHED_H)
204205
CHECK_INCLUDE_FILES (select.h HAVE_SELECT_H)

include/my_net.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ C_MODE_START
3636
#ifdef HAVE_ARPA_INET_H
3737
#include <arpa/inet.h>
3838
#endif
39-
#ifdef HAVE_POLL
39+
#if defined(HAVE_POLL_H)
40+
#include <poll.h>
41+
#elif defined(HAVE_SYS_POLL_H)
4042
#include <sys/poll.h>
41-
#endif
43+
#endif /* defined(HAVE_POLL_H) */
4244
#ifdef HAVE_SYS_IOCTL_H
4345
#include <sys/ioctl.h>
4446
#endif

libmysql/libmysql.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@
4747
#include <sys/select.h>
4848
#endif
4949
#endif /* !defined(__WIN__) */
50-
#ifdef HAVE_POLL
50+
#if defined(HAVE_POLL_H)
51+
#include <poll.h>
52+
#elif defined(HAVE_SYS_POLL_H)
5153
#include <sys/poll.h>
52-
#endif
54+
#endif /* defined(HAVE_POLL_H) */
5355
#ifdef HAVE_SYS_UN_H
5456
#include <sys/un.h>
5557
#endif

storage/mroonga/vendor/groonga/lib/com.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ grn_com_event_add(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
348348
struct epoll_event e;
349349
memset(&e, 0, sizeof(struct epoll_event));
350350
e.data.fd = (fd);
351-
e.events = (__uint32_t) events;
351+
e.events = (uint32_t) events;
352352
if (epoll_ctl(ev->epfd, EPOLL_CTL_ADD, (fd), &e) == -1) {
353353
SERR("epoll_ctl");
354354
return ctx->rc;
@@ -396,7 +396,7 @@ grn_com_event_mod(grn_ctx *ctx, grn_com_event *ev, grn_sock fd, int events, grn_
396396
struct epoll_event e;
397397
memset(&e, 0, sizeof(struct epoll_event));
398398
e.data.fd = (fd);
399-
e.events = (__uint32_t) events;
399+
e.events = (uint32_t) events;
400400
if (epoll_ctl(ev->epfd, EPOLL_CTL_MOD, (fd), &e) == -1) {
401401
SERR("epoll_ctl");
402402
return ctx->rc;

storage/mroonga/vendor/groonga/lib/grn_com.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ GRN_API grn_com_queue_entry *grn_com_queue_deque(grn_ctx *ctx, grn_com_queue *q)
8383
# define GRN_COM_POLLIN EVFILT_READ
8484
# define GRN_COM_POLLOUT EVFILT_WRITE
8585
# else /* USE_KQUEUE */
86-
# include <sys/poll.h>
86+
# if defined(HAVE_POLL_H)
87+
# include <poll.h>
88+
# elif defined(HAVE_SYS_POLL_H)
89+
# include <sys/poll.h>
90+
# endif /* defined(HAVE_POLL_H) */
8791
# define GRN_COM_POLLIN POLLIN
8892
# define GRN_COM_POLLOUT POLLOUT
8993
# endif /* USE_KQUEUE */

storage/tokudb/PerconaFT/cmake_modules/TokuFeatureDetection.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ if (NOT HAVE_BACKTRACE_WITHOUT_EXECINFO)
9393
if (HAVE_BACKTRACE_WITH_EXECINFO)
9494
list(APPEND EXTRA_SYSTEM_LIBS execinfo)
9595
else ()
96-
message(FATAL_ERROR "Cannot find backtrace(), even with -lexecinfo.")
96+
message(WARNING "Cannot find backtrace(), even with -lexecinfo.")
9797
endif ()
9898
endif ()
9999

strings/my_vsnprintf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ void my_strerror(char *buf, size_t len, int nr)
831831
(defined _XOPEN_SOURCE && (_XOPEN_SOURCE >= 600))) && \
832832
! defined _GNU_SOURCE
833833
strerror_r(nr, buf, len); /* I can build with or without GNU */
834-
#elif defined _GNU_SOURCE
834+
#elif defined(__GLIBC__) && defined (_GNU_SOURCE)
835835
char *r= strerror_r(nr, buf, len);
836836
if (r != buf) /* Want to help, GNU? */
837837
strmake(buf, r, len - 1); /* Then don't. */

0 commit comments

Comments
 (0)