summaryrefslogtreecommitdiff
path: root/dev-libs/bglibs/files/bglibs-2.04-musl.patch
blob: 65819699926ab41be09024b5c24f418fd36c4f43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
From 999598621421a46ef2d11244f57b70855a28ec60 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Fri, 7 Feb 2025 04:43:56 +0000
Subject: [PATCH 1/3] net/{bindu,connectu}.c: add missing <string.h> includes

These two files call strcpy() which is defined in string.h. It's
probably included transitively on glibc, but on musl this leads
to a build failure.
---
 net/bindu.c    | 1 +
 net/connectu.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/net/bindu.c b/net/bindu.c
index bf228dd..3d30579 100644
--- a/net/bindu.c
+++ b/net/bindu.c
@@ -21,6 +21,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
+#include <string.h>
 #include "socket.h"
 
 /** Bind a UNIX domain address (path) to a socket. */
diff --git a/net/connectu.c b/net/connectu.c
index a0a00ad..a82b9aa 100644
--- a/net/connectu.c
+++ b/net/connectu.c
@@ -21,6 +21,7 @@
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <unistd.h>
+#include <string.h>
 #include "socket.h"
 
 /** Make an UNIX domain connection. */

From d930f1ff4043e25c1d5427e474af0de4cc787e2c Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Fri, 7 Feb 2025 04:45:12 +0000
Subject: [PATCH 2/3] unix/sig_all.c: drop <sys/signal.h> include

The POSIX name for this header is <signal.h>,

  https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/signal.h.html

and while the "sys" name still works, it now generates a warning on
musl

  In file included from unix/sig_all.c:2:
  /usr/include/sys/signal.h:1:2: warning: #warning redirecting incorrect
  #include <sys/signal.h> to <signal.h> [-Wcpp]
    1 | #warning redirecting incorrect #include <sys/signal.h> to <signal.h>
      |  ^~~~~~~

and presumably will not work forever.
---
 unix/sig_all.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/unix/sig_all.c b/unix/sig_all.c
index b8821de..f2cb1e4 100644
--- a/unix/sig_all.c
+++ b/unix/sig_all.c
@@ -1,5 +1,4 @@
 #include <signal.h>
-#include <sys/signal.h>
 #include "sig.h"
 #include "sysdeps.h"
 

From 5069fe01396d465c3d39ed8353f5d88538086b0d Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Fri, 7 Feb 2025 13:48:38 +0000
Subject: [PATCH 3/3] selftests.sh: fgrep -> grep -F

GNU grep now warns that "fgrep" is obsolete:

  Creating temporary directory selftests.sh.tmp.35861
  fgrep: warning: fgrep is obsolescent; using /bin/grep -F

The "-F" flag is part of POSIX and should be reliable.
---
 selftests.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/selftests.sh b/selftests.sh
index 23c7719..8d9944f 100644
--- a/selftests.sh
+++ b/selftests.sh
@@ -48,7 +48,7 @@ if [ $# -gt 0 ]; then
     do_test $c || exitcode=false
   done
 else
-  for c in `fgrep -l '#ifdef SELFTEST_MAIN' */*.c`
+  for c in `grep -F -l '#ifdef SELFTEST_MAIN' */*.c`
   do
     do_test $c || exitcode=false
   done