summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch46
-rw-r--r--meta-oe/recipes-support/daemonize/daemonize_git.bb4
2 files changed, 49 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch b/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch
new file mode 100644
index 0000000000..3a79dba682
--- /dev/null
+++ b/meta-oe/recipes-support/daemonize/daemonize/0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch
@@ -0,0 +1,46 @@
1From c47fdcc0a900aea93b1967c20db42743171ab1ac Mon Sep 17 00:00:00 2001
2From: "mark.yang" <mark.yang@lge.com>
3Date: Thu, 27 Mar 2025 16:46:42 +0900
4Subject: [PATCH] fix getopt.c too many arguments to function 'write' error in
5 gcc-15.0.1
6
7In the original code, write() was declared as 'extern int write();',
8which is interpreted as a function taking no parameters.
9This caused errors when actually calling it with 3 parameters.
10The current fix to declare it as 'extern int write(int, const void *, unsigned);'
11is the correct solution.
12This properly defines the write function to accept 3 parameters.
13
14../git/getopt.c: In function 'x_getopt':
15../git/getopt.c:51:16: error: too many arguments to function 'write'; expected 0, have 3
16 51 | (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
17 | ^~~~~ ~
18../git/getopt.c:78:17: note: in expansion of macro 'ERR'
19 78 | ERR(": illegal option -- ", c);
20 | ^~~
21../git/getopt.c:48:20: note: declared here
22 48 | extern int write();\
23 | ^~~~~
24
25Upstream-Status: Submitted [https://github.com/bmc/daemonize/pull/37]
26Signed-off-by: mark.yang <mark.yang@lge.com>
27---
28 getopt.c | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/getopt.c b/getopt.c
32index 3f37c55..f298da7 100644
33--- a/getopt.c
34+++ b/getopt.c
35@@ -45,7 +45,7 @@
36 #include <string.h>
37
38 #define ERR(s, c) if(x_opterr){\
39- extern int write();\
40+ extern int write(int, const void *, unsigned);\
41 char errbuf[2];\
42 errbuf[0] = c; errbuf[1] = '\n';\
43 (void) write(2, argv[0], (unsigned)strlen(argv[0]));\
44--
452.34.1
46
diff --git a/meta-oe/recipes-support/daemonize/daemonize_git.bb b/meta-oe/recipes-support/daemonize/daemonize_git.bb
index f46dec59fc..b0712e521b 100644
--- a/meta-oe/recipes-support/daemonize/daemonize_git.bb
+++ b/meta-oe/recipes-support/daemonize/daemonize_git.bb
@@ -7,7 +7,9 @@ PV = "1.7.8"
7inherit autotools 7inherit autotools
8 8
9SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c" 9SRCREV = "18869a797dab12bf1c917ba3b4782fef484c407c"
10SRC_URI = "git://github.com/bmc/daemonize.git;branch=master;protocol=https \ 10SRC_URI = " \
11 git://github.com/bmc/daemonize.git;branch=master;protocol=https \
12 file://0001-fix-getopt.c-too-many-arguments-to-function-write-er.patch \
11" 13"
12 14
13S = "${WORKDIR}/git" 15S = "${WORKDIR}/git"