From a014c358280b01bbe8d6ab66735ba8f9b948d80e Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 28 Dec 2014 07:29:24 +0100 Subject: [PATCH] acpid: portability patch to unbreak musl builds. --- srcpkgs/acpid/patches/portability.patch | 67 +++++++++++++++++++++++++ srcpkgs/acpid/template | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/acpid/patches/portability.patch diff --git a/srcpkgs/acpid/patches/portability.patch b/srcpkgs/acpid/patches/portability.patch new file mode 100644 index 00000000000..56d7f876900 --- /dev/null +++ b/srcpkgs/acpid/patches/portability.patch @@ -0,0 +1,67 @@ +Portability fixes: + +- Do not use isfdtype()... rather use fstat(2). +- Define TEMP_FAILURE_RETRY if needed. + +--- acpid.h 2014-02-26 01:36:58.788146100 +0100 ++++ 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 + */ +--- kacpimon/libnetlink.c 2013-02-24 14:20:06.624844873 +0100 ++++ 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) +--- libnetlink.c 2012-07-15 00:29:38.168312376 +0200 ++++ 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) +--- sock.c 2013-08-15 01:30:44.655673004 +0200 ++++ sock.c 2014-12-28 07:11:31.198737890 +0100 +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -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 f7d8190e1bf..7d12e2b3482 100644 --- a/srcpkgs/acpid/template +++ b/srcpkgs/acpid/template @@ -1,7 +1,7 @@ # Template file for 'acpid' pkgname=acpid version=2.0.23 -revision=6 +revision=7 build_options="systemd" build_style=gnu-configure conf_files="/etc/acpi/events/anything /etc/acpi/handler.sh"