|
@@ -0,0 +1,129 @@
|
|
1
|
+Index: acpid-2.0.23/tempfailure.h
|
|
2
|
+===================================================================
|
|
3
|
+--- /dev/null
|
|
4
|
++++ acpid-2.0.23/tempfailure.h
|
|
5
|
+@@ -0,0 +1,8 @@
|
|
6
|
++#ifndef TEMP_FAILURE_RETRY
|
|
7
|
++#define TEMP_FAILURE_RETRY(expression) \
|
|
8
|
++ (__extension__ \
|
|
9
|
++ ({ long int __result; \
|
|
10
|
++ do __result = (long int) (expression); \
|
|
11
|
++ while (__result == -1L && errno == EINTR); \
|
|
12
|
++ __result; }))
|
|
13
|
++#endif
|
|
14
|
+Index: acpid-2.0.23/acpi_listen.c
|
|
15
|
+===================================================================
|
|
16
|
+--- acpid-2.0.23.orig/acpi_listen.c
|
|
17
|
++++ acpid-2.0.23/acpi_listen.c
|
|
18
|
+@@ -39,6 +39,8 @@
|
|
19
|
+ #include "acpid.h"
|
|
20
|
+ #include "ud_socket.h"
|
|
21
|
+
|
|
22
|
++#include "tempfailure.h"
|
|
23
|
++
|
|
24
|
+ static int handle_cmdline(int *argc, char ***argv);
|
|
25
|
+ static char *read_line(int fd);
|
|
26
|
+
|
|
27
|
+Index: acpid-2.0.23/acpid.c
|
|
28
|
+===================================================================
|
|
29
|
+--- acpid-2.0.23.orig/acpid.c
|
|
30
|
++++ acpid-2.0.23/acpid.c
|
|
31
|
+@@ -41,6 +41,7 @@
|
|
32
|
+ #include "input_layer.h"
|
|
33
|
+ #include "inotify_handler.h"
|
|
34
|
+ #include "netlink.h"
|
|
35
|
++#include "tempfailure.h"
|
|
36
|
+
|
|
37
|
+ static int handle_cmdline(int *argc, char ***argv);
|
|
38
|
+ static void close_fds(void);
|
|
39
|
+Index: acpid-2.0.23/event.c
|
|
40
|
+===================================================================
|
|
41
|
+--- acpid-2.0.23.orig/event.c
|
|
42
|
++++ acpid-2.0.23/event.c
|
|
43
|
+@@ -40,6 +40,9 @@
|
|
44
|
+ #include "sock.h"
|
|
45
|
+ #include "ud_socket.h"
|
|
46
|
+ #include "event.h"
|
|
47
|
++
|
|
48
|
++#include "tempfailure.h"
|
|
49
|
++
|
|
50
|
+ /*
|
|
51
|
+ * What is a rule? It's polymorphic, pretty much.
|
|
52
|
+ */
|
|
53
|
+Index: acpid-2.0.23/input_layer.c
|
|
54
|
+===================================================================
|
|
55
|
+--- acpid-2.0.23.orig/input_layer.c
|
|
56
|
++++ acpid-2.0.23/input_layer.c
|
|
57
|
+@@ -47,6 +47,8 @@
|
|
58
|
+
|
|
59
|
+ #define DIM(a) (sizeof(a) / sizeof(a[0]))
|
|
60
|
+
|
|
61
|
++#include "tempfailure.h"
|
|
62
|
++
|
|
63
|
+ struct evtab_entry {
|
|
64
|
+ struct input_event event;
|
|
65
|
+ const char *str;
|
|
66
|
+Index: acpid-2.0.23/kacpimon/libnetlink.c
|
|
67
|
+===================================================================
|
|
68
|
+--- acpid-2.0.23.orig/kacpimon/libnetlink.c
|
|
69
|
++++ acpid-2.0.23/kacpimon/libnetlink.c
|
|
70
|
+@@ -26,6 +26,8 @@
|
|
71
|
+
|
|
72
|
+ #include "libnetlink.h"
|
|
73
|
+
|
|
74
|
++#include "../tempfailure.h"
|
|
75
|
++
|
|
76
|
+ void rtnl_close(struct rtnl_handle *rth)
|
|
77
|
+ {
|
|
78
|
+ if (rth->fd >= 0) {
|
|
79
|
+Index: acpid-2.0.23/netlink.c
|
|
80
|
+===================================================================
|
|
81
|
+--- acpid-2.0.23.orig/netlink.c
|
|
82
|
++++ acpid-2.0.23/netlink.c
|
|
83
|
+@@ -46,6 +46,7 @@
|
|
84
|
+ #include "connection_list.h"
|
|
85
|
+
|
|
86
|
+ #include "netlink.h"
|
|
87
|
++#include "tempfailure.h"
|
|
88
|
+
|
|
89
|
+ static void
|
|
90
|
+ format_netlink(struct nlmsghdr *msg)
|
|
91
|
+Index: acpid-2.0.23/proc.c
|
|
92
|
+===================================================================
|
|
93
|
+--- acpid-2.0.23.orig/proc.c
|
|
94
|
++++ acpid-2.0.23/proc.c
|
|
95
|
+@@ -34,6 +34,8 @@
|
|
96
|
+
|
|
97
|
+ #include "proc.h"
|
|
98
|
+
|
|
99
|
++#include "tempfailure.h"
|
|
100
|
++
|
|
101
|
+ const char *eventfile = ACPID_EVENTFILE;
|
|
102
|
+
|
|
103
|
+ static char *read_line(int fd);
|
|
104
|
+Index: acpid-2.0.23/ud_socket.c
|
|
105
|
+===================================================================
|
|
106
|
+--- acpid-2.0.23.orig/ud_socket.c
|
|
107
|
++++ acpid-2.0.23/ud_socket.c
|
|
108
|
+@@ -22,6 +22,8 @@
|
|
109
|
+ #include "log.h"
|
|
110
|
+ #include "ud_socket.h"
|
|
111
|
+
|
|
112
|
++#include "tempfailure.h"
|
|
113
|
++
|
|
114
|
+ int
|
|
115
|
+ ud_create_socket(const char *name, mode_t socketmode)
|
|
116
|
+ {
|
|
117
|
+Index: acpid-2.0.23/libnetlink.c
|
|
118
|
+===================================================================
|
|
119
|
+--- acpid-2.0.23.orig/libnetlink.c
|
|
120
|
++++ acpid-2.0.23/libnetlink.c
|
|
121
|
+@@ -26,6 +26,8 @@
|
|
122
|
+
|
|
123
|
+ #include "libnetlink.h"
|
|
124
|
+
|
|
125
|
++#include "tempfailure.h"
|
|
126
|
++
|
|
127
|
+ void rtnl_close(struct rtnl_handle *rth)
|
|
128
|
+ {
|
|
129
|
+ if (rth->fd >= 0) {
|