From 1a2e0c28203dcb829b3822dc6dfbcc9c24387b6f Mon Sep 17 00:00:00 2001 From: Wiylan Date: Mon, 30 Jun 2025 19:41:34 +0200 Subject: [PATCH] acpid: fix musl build --- srcpkgs/acpid/patches/fix-musl.patch | 18 ++++++++ srcpkgs/acpid/patches/portability.patch | 59 ------------------------- srcpkgs/acpid/template | 2 +- 3 files changed, 19 insertions(+), 60 deletions(-) create mode 100644 srcpkgs/acpid/patches/fix-musl.patch delete mode 100644 srcpkgs/acpid/patches/portability.patch diff --git a/srcpkgs/acpid/patches/fix-musl.patch b/srcpkgs/acpid/patches/fix-musl.patch new file mode 100644 index 00000000000..ee32eb0e252 --- /dev/null +++ b/srcpkgs/acpid/patches/fix-musl.patch @@ -0,0 +1,18 @@ +From 6c4c7636f9629914d85531ea1dfe6abc275164ac Mon Sep 17 00:00:00 2001 +From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org> +Date: Wed, 25 Oct 2023 15:23:20 +0000 +Subject: [PATCH] community/acpid: fix lfs64 usage + +--- a/sock.c ++++ b/sock.c +@@ -54,8 +54,8 @@ + static int + isfdtype(int fd, int fdtype) + { +- struct stat64 st; +- if (fstat64(fd, &st) != 0) ++ struct stat st; ++ if (fstat(fd, &st) != 0) + return -1; + return ((st.st_mode & S_IFMT) == (mode_t)fdtype); + } diff --git a/srcpkgs/acpid/patches/portability.patch b/srcpkgs/acpid/patches/portability.patch deleted file mode 100644 index 05a2062b5f1..00000000000 --- a/srcpkgs/acpid/patches/portability.patch +++ /dev/null @@ -1,59 +0,0 @@ -Portability fixes: - -- Do not use isfdtype()... rather use fstat(2). -- Define TEMP_FAILURE_RETRY if needed. - ---- a/acpid.h 2014-02-26 01:36:58.788146100 +0100 -+++ b/acpid.h 2014-12-28 06:58:18.252702509 +0100 -@@ -39,6 +39,15 @@ - - #define PACKAGE "acpid" - -+#ifndef TEMP_FAILURE_RETRY -+# define TEMP_FAILURE_RETRY(expression) \ -+ (__extension__ \ -+ ({ long int __result; \ -+ do __result = (long int) (expression); \ -+ while (__result == -1L && errno == EINTR); \ -+ __result; })) -+#endif -+ - /* - * acpid.c - */ ---- a/kacpimon/libnetlink.c 2013-02-24 14:20:06.624844873 +0100 -+++ b/kacpimon/libnetlink.c 2014-12-28 06:59:50.283706615 +0100 -@@ -24,6 +24,7 @@ - #include - #include - -+#include "acpid.h" - #include "libnetlink.h" - - void rtnl_close(struct rtnl_handle *rth) ---- a/libnetlink.c 2012-07-15 00:29:38.168312376 +0200 -+++ b/libnetlink.c 2014-12-28 06:59:17.379705147 +0100 -@@ -24,6 +24,7 @@ - #include - #include - -+#include "acpid.h" - #include "libnetlink.h" - - void rtnl_close(struct rtnl_handle *rth) ---- a/sock.c 2013-08-15 01:30:44.655673004 +0200 -+++ b/sock.c 2014-12-28 07:11:31.198737890 +0100 -@@ -53,7 +54,12 @@ int non_root_clients; - int - is_socket(int fd) - { -- return (isfdtype(fd, S_IFSOCK) == 1); -+ struct stat st; -+ -+ if (fstat(fd, &st) == 0) -+ return S_ISSOCK(st.st_mode); -+ -+ return -1; - } - - /* accept a new client connection */ diff --git a/srcpkgs/acpid/template b/srcpkgs/acpid/template index 4adf3f24bb8..fc754a24b3a 100644 --- a/srcpkgs/acpid/template +++ b/srcpkgs/acpid/template @@ -1,7 +1,7 @@ # Template file for 'acpid' pkgname=acpid version=2.0.34 -revision=3 +revision=4 build_style=gnu-configure short_desc="ACPI Daemon (acpid) With Netlink Support" maintainer="Enno Boland "