commit:     d98d4d103b34e15df6b3ac9902a945d2336fc5c8
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Sun Feb 16 11:58:23 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 16 12:04:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d98d4d10

sys-process/atop: fix build for USE=modules

netatop is separate source base that thankfully has right declarations
but bad definitions. Patching definitions, but only when USE=modules

Closes: https://bugs.gentoo.org/949835
Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Closes: https://github.com/gentoo/gentoo/pull/40593
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-process/atop/atop-2.11.0-r1.ebuild             |  1 +
 .../files/netatop-3.2.2-strict-prototype.patch     | 77 ++++++++++++++++++++++
 2 files changed, 78 insertions(+)

diff --git a/sys-process/atop/atop-2.11.0-r1.ebuild 
b/sys-process/atop/atop-2.11.0-r1.ebuild
index c6445c5dd8c0..14723c254228 100644
--- a/sys-process/atop/atop-2.11.0-r1.ebuild
+++ b/sys-process/atop/atop-2.11.0-r1.ebuild
@@ -51,6 +51,7 @@ src_prepare() {
 
        if use modules ; then
                cd "${WORKDIR}"/${NETATOP_P} || die
+               eapply "${FILESDIR}/netatop-3.2.2-strict-prototype.patch"
 
                sed \
                        -e "s#\`uname -r\`#${KV_FULL}#g" \

diff --git a/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch 
b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch
new file mode 100644
index 000000000000..3cb1d6fc5040
--- /dev/null
+++ b/sys-process/atop/files/netatop-3.2.2-strict-prototype.patch
@@ -0,0 +1,77 @@
+Fix for strict prototypes error: declarations are fine,
+definitions are missing void
+https://bugs.gentoo.org/949835
+--- a/netatop.c        2024-06-01 15:19:08.000000000 +0400
++++ b/netatop.c        2025-02-16 15:48:07.094848633 +0400
+@@ -1053,7 +1053,7 @@
+ ** can be found at the head
+ */
+ static void
+-gctaskexit()
++gctaskexit(void)
+ {
+       unsigned long   flags;
+       struct taskinfo *tip;
+@@ -1087,7 +1087,7 @@
+ ** cleanup sockinfo structures that are connected to finished processes
+ */
+ static void
+-gcsockinfo()
++gcsockinfo(void)
+ {
+       int             i;
+       struct sockinfo *sip, *sipsave;
+@@ -1300,7 +1300,7 @@
+ ** remove taskinfo structures of finished tasks from hash list
+ */
+ static void
+-gctaskinfo()
++gctaskinfo(void)
+ {
+       int             i;
+       struct taskinfo *tip, *tipsave;
+@@ -1376,7 +1376,7 @@
+ ** remove all sockinfo structs
+ */
+ static void
+-wipesockinfo()
++wipesockinfo(void)
+ {
+       struct sockinfo *sip, *sipsave;
+       int             i;
+@@ -1404,7 +1404,7 @@
+ ** remove all taskinfo structs from hash list
+ */
+ static void
+-wipetaskinfo()
++wipetaskinfo(void)
+ {
+       struct taskinfo *tip, *tipsave;
+       int             i;
+@@ -1432,7 +1432,7 @@
+ ** remove all taskinfo structs from exit list
+ */
+ static void
+-wipetaskexit()
++wipetaskexit(void)
+ {
+       gctaskexit();
+ }
+@@ -1768,7 +1768,7 @@
+ ** called when module loaded
+ */
+ int
+-init_module()
++init_module(void)
+ {
+       int i;
+ 
+@@ -1869,7 +1869,7 @@
+ ** called when module unloaded
+ */
+ void
+-cleanup_module()
++cleanup_module(void)
+ {
+       /*
+       ** tell kernel daemon to stop

Reply via email to