Index: acpid-2.0.23/tempfailure.h
|
|
===================================================================
|
|
--- /dev/null
|
|
+++ acpid-2.0.23/tempfailure.h
|
|
@@ -0,0 +1,8 @@
|
|
+#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
|
|
Index: acpid-2.0.23/acpi_listen.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/acpi_listen.c
|
|
+++ acpid-2.0.23/acpi_listen.c
|
|
@@ -39,6 +39,8 @@
|
|
#include "acpid.h"
|
|
#include "ud_socket.h"
|
|
|
|
+#include "tempfailure.h"
|
|
+
|
|
static int handle_cmdline(int *argc, char ***argv);
|
|
static char *read_line(int fd);
|
|
|
|
Index: acpid-2.0.23/acpid.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/acpid.c
|
|
+++ acpid-2.0.23/acpid.c
|
|
@@ -41,6 +41,7 @@
|
|
#include "input_layer.h"
|
|
#include "inotify_handler.h"
|
|
#include "netlink.h"
|
|
+#include "tempfailure.h"
|
|
|
|
static int handle_cmdline(int *argc, char ***argv);
|
|
static void close_fds(void);
|
|
Index: acpid-2.0.23/event.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/event.c
|
|
+++ acpid-2.0.23/event.c
|
|
@@ -40,6 +40,9 @@
|
|
#include "sock.h"
|
|
#include "ud_socket.h"
|
|
#include "event.h"
|
|
+
|
|
+#include "tempfailure.h"
|
|
+
|
|
/*
|
|
* What is a rule? It's polymorphic, pretty much.
|
|
*/
|
|
Index: acpid-2.0.23/input_layer.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/input_layer.c
|
|
+++ acpid-2.0.23/input_layer.c
|
|
@@ -47,6 +47,8 @@
|
|
|
|
#define DIM(a) (sizeof(a) / sizeof(a[0]))
|
|
|
|
+#include "tempfailure.h"
|
|
+
|
|
struct evtab_entry {
|
|
struct input_event event;
|
|
const char *str;
|
|
Index: acpid-2.0.23/kacpimon/libnetlink.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/kacpimon/libnetlink.c
|
|
+++ acpid-2.0.23/kacpimon/libnetlink.c
|
|
@@ -26,6 +26,8 @@
|
|
|
|
#include "libnetlink.h"
|
|
|
|
+#include "../tempfailure.h"
|
|
+
|
|
void rtnl_close(struct rtnl_handle *rth)
|
|
{
|
|
if (rth->fd >= 0) {
|
|
Index: acpid-2.0.23/netlink.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/netlink.c
|
|
+++ acpid-2.0.23/netlink.c
|
|
@@ -46,6 +46,7 @@
|
|
#include "connection_list.h"
|
|
|
|
#include "netlink.h"
|
|
+#include "tempfailure.h"
|
|
|
|
static void
|
|
format_netlink(struct nlmsghdr *msg)
|
|
Index: acpid-2.0.23/proc.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/proc.c
|
|
+++ acpid-2.0.23/proc.c
|
|
@@ -34,6 +34,8 @@
|
|
|
|
#include "proc.h"
|
|
|
|
+#include "tempfailure.h"
|
|
+
|
|
const char *eventfile = ACPID_EVENTFILE;
|
|
|
|
static char *read_line(int fd);
|
|
Index: acpid-2.0.23/ud_socket.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/ud_socket.c
|
|
+++ acpid-2.0.23/ud_socket.c
|
|
@@ -22,6 +22,8 @@
|
|
#include "log.h"
|
|
#include "ud_socket.h"
|
|
|
|
+#include "tempfailure.h"
|
|
+
|
|
int
|
|
ud_create_socket(const char *name, mode_t socketmode)
|
|
{
|
|
Index: acpid-2.0.23/libnetlink.c
|
|
===================================================================
|
|
--- acpid-2.0.23.orig/libnetlink.c
|
|
+++ acpid-2.0.23/libnetlink.c
|
|
@@ -26,6 +26,8 @@
|
|
|
|
#include "libnetlink.h"
|
|
|
|
+#include "tempfailure.h"
|
|
+
|
|
void rtnl_close(struct rtnl_handle *rth)
|
|
{
|
|
if (rth->fd >= 0) {
|