summaryrefslogtreecommitdiffstats
path: root/main/musl/0003-3fa2eb2a-to-70d9c303.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/musl/0003-3fa2eb2a-to-70d9c303.patch')
-rw-r--r--main/musl/0003-3fa2eb2a-to-70d9c303.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/main/musl/0003-3fa2eb2a-to-70d9c303.patch b/main/musl/0003-3fa2eb2a-to-70d9c303.patch
new file mode 100644
index 000000000..f2d218cee
--- /dev/null
+++ b/main/musl/0003-3fa2eb2a-to-70d9c303.patch
@@ -0,0 +1,84 @@
+diff --git a/configure b/configure
+index 0cff13d..b1cf998 100755
+--- a/configure
++++ b/configure
+@@ -298,12 +298,9 @@ fi
+ tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns
+
+ #
+-# If debugging is explicitly enabled, don't auto-enable optimizations
++# Enable debugging if requessted.
+ #
+-if test "$debug" = yes ; then
+-CFLAGS_AUTO=-g
+-test "$optimize" = auto && optimize=no
+-fi
++test "$debug" = yes && CFLAGS_AUTO=-g
+
+ #
+ # Possibly add a -O option to CFLAGS and select modules to optimize with
+diff --git a/include/syslog.h b/include/syslog.h
+index 71dbd99..5b4d296 100644
+--- a/include/syslog.h
++++ b/include/syslog.h
+@@ -69,21 +69,17 @@ void vsyslog (int, const char *, va_list);
+ #if defined(SYSLOG_NAMES)
+ #define INTERNAL_NOPRI 0x10
+ #define INTERNAL_MARK (LOG_NFACILITIES<<3)
+-struct __CODE {
+- const char *c_name;
+- int c_val;
+-};
+ typedef struct {
+ char *c_name;
+ int c_val;
+ } CODE;
+-#define prioritynames ((CODE *)(const struct __CODE []){ \
++#define prioritynames ((CODE *)(const CODE []){ \
+ { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "debug", LOG_DEBUG }, \
+ { "emerg", LOG_EMERG }, { "err", LOG_ERR }, { "error", LOG_ERR }, \
+ { "info", LOG_INFO }, { "none", INTERNAL_NOPRI }, \
+ { "notice", LOG_NOTICE }, { "panic", LOG_EMERG }, \
+ { "warn", LOG_WARNING }, { "warning", LOG_WARNING }, { 0, -1 } })
+-#define facilitynames ((CODE *)(const struct __CODE []){ \
++#define facilitynames ((CODE *)(const CODE []){ \
+ { "auth", LOG_AUTH }, { "authpriv", LOG_AUTHPRIV }, \
+ { "cron", LOG_CRON }, { "daemon", LOG_DAEMON }, { "ftp", LOG_FTP }, \
+ { "kern", LOG_KERN }, { "lpr", LOG_LPR }, { "mail", LOG_MAIL }, \
+diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c
+index 73e7644..66e0330 100644
+--- a/src/network/gethostbyaddr_r.c
++++ b/src/network/gethostbyaddr_r.c
+@@ -18,6 +18,8 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af,
+ socklen_t sl = af==AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin;
+ int i;
+
++ *res = 0;
++
+ /* Load address argument into sockaddr structure */
+ if (af==AF_INET6 && l==16) memcpy(&sa.sin6.sin6_addr, a, 16);
+ else if (af==AF_INET && l==4) memcpy(&sa.sin.sin_addr, a, 4);
+diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c
+index aa8b0a9..81f71d2 100644
+--- a/src/network/gethostbyname2_r.c
++++ b/src/network/gethostbyname2_r.c
+@@ -17,6 +17,7 @@ int gethostbyname2_r(const char *name, int af,
+ int i, cnt;
+ size_t align, need;
+
++ *res = 0;
+ cnt = __lookup_name(addrs, canon, name, af, AI_CANONNAME);
+ if (cnt<0) switch (cnt) {
+ case EAI_NONAME:
+diff --git a/src/network/sendmmsg.c b/src/network/sendmmsg.c
+index ff9f861..eeae1d0 100644
+--- a/src/network/sendmmsg.c
++++ b/src/network/sendmmsg.c
+@@ -12,6 +12,7 @@ int sendmmsg(int fd, struct mmsghdr *msgvec, unsigned int vlen, unsigned int fla
+ * and the cmsg blocks cannot be modified in-place. */
+ int i;
+ if (vlen > IOV_MAX) vlen = IOV_MAX; /* This matches the kernel. */
++ if (!vlen) return 0;
+ for (i=0; i<vlen; i++) {
+ /* As an unfortunate inconsistency, the sendmmsg API uses
+ * unsigned int for the resulting msg_len, despite sendmsg