summaryrefslogtreecommitdiff
path: root/sys-process/anacron/files/anacron-2.3-sighandlers.patch
blob: cc4c62bca21c7d86fa551f8d1d7e469d04392f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
https://bugs.gentoo.org/943949
Correct signal handler signatures.
Also prevent unexpected environment modification
by strdup'ing new environment. Mutes const qualifier
discard warning, too.
--- a/main.c
+++ b/main.c
@@ -214,19 +214,19 @@
 }
 
 void
-handle_sigalrm()
+handle_sigalrm(int)
 {
     got_sigalrm = 1;
 }
 
 void
-handle_sigchld()
+handle_sigchld(int)
 {
     got_sigchld = 1;
 }
 
 void
-handle_sigusr1()
+handle_sigusr1(int)
 {
     got_sigusr1 = 1;
 }
--- a/runjob.c
+++ b/runjob.c
@@ -86,7 +86,7 @@
 static void
 xputenv(const char *s)
 {
-    if (putenv(s)) die_e("Can't set the environment");
+    if (putenv(strdup(s))) die_e("Can't set the environment");
 }
 
 static void