Fix FTBFS on hurd (Svante Signell).
Adam Borowski
6 years ago
0 | Index: openrc-0.34/src/rc/supervise-daemon.c | |
1 | =================================================================== | |
2 | --- openrc-0.34.orig/src/rc/supervise-daemon.c | |
3 | +++ openrc-0.34/src/rc/supervise-daemon.c | |
4 | @@ -446,7 +446,9 @@ static void supervisor(char *exec, char | |
5 | signal_setup_restart(SIGEMT, handle_signal); | |
6 | #endif | |
7 | signal_setup_restart(SIGIO, handle_signal); | |
8 | +#ifdef SIGPWR | |
9 | signal_setup_restart(SIGPWR, handle_signal); | |
10 | +#endif | |
11 | #ifdef SIGUNUSED | |
12 | signal_setup_restart(SIGUNUSED, handle_signal); | |
13 | #endif | |
14 | Index: openrc-0.34/mk/os-GNU.mk | |
15 | =================================================================== | |
16 | --- openrc-0.34.orig/mk/os-GNU.mk | |
17 | +++ openrc-0.34/mk/os-GNU.mk | |
18 | @@ -12,4 +12,5 @@ SFX= .GNU.in | |
19 | PKG_PREFIX?= /usr | |
20 | ||
21 | CPPFLAGS+= -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -DMAXPATHLEN=4096 -DPATH_MAX=4096 | |
22 | +CFLAGS+= -DPATH_MAX=4096 | |
23 | LIBDL= -Wl,-Bdynamic -ldl | |
24 | Index: openrc-0.34/src/lsb2rcconf/GNUmakefile | |
25 | =================================================================== | |
26 | --- openrc-0.34.orig/src/lsb2rcconf/GNUmakefile | |
27 | +++ openrc-0.34/src/lsb2rcconf/GNUmakefile | |
28 | @@ -5,9 +5,12 @@ COMPRESS_MAN ?= yes | |
29 | STRIP_BINARY ?= yes | |
30 | #EXAMPLES ?= yes | |
31 | ||
32 | -STDFLAG ?= -D_BSD_SOURCE | |
33 | +MK= ../../mk | |
34 | +include ${MK}/os.mk | |
35 | + | |
36 | +STDFLAG ?= -D_DEFAULT_SOURCE | |
37 | CSECFLAGS ?= -fstack-protector-all -Wall --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fstack-check -DPARANOID | |
38 | -CFLAGS ?= -march=native -pipe -O2 -std=c99 | |
39 | +CFLAGS += -march=native -pipe -O2 -std=c99 | |
40 | CFLAGS += $(CSECFLAGS) $(STDFLAG) | |
41 | DEBUGCFLAGS ?= -pipe -Wall -Werror -ggdb3 -Wno-error=unused-variable $(CSECFLAGS) | |
42 | ||
43 | Index: openrc-0.34/src/lsb2rcconf/main.c | |
44 | =================================================================== | |
45 | --- openrc-0.34.orig/src/lsb2rcconf/main.c | |
46 | +++ openrc-0.34/src/lsb2rcconf/main.c | |
47 | @@ -39,9 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
48 | #define hsearch_data_t struct hsearch_data | |
49 | #endif | |
50 | ||
51 | -#include <stdio.h> /* fprintf() */ | |
52 | +#include <stdio.h> /* fprintf(), perror() */ | |
53 | #include <stdlib.h> /* exit() */ | |
54 | -#include <string.h> /* strcmp() */ | |
55 | +#include <string.h> /* strcmp(), strerror() */ | |
56 | #include <errno.h> /* ENVAL */ | |
57 | #include <libgen.h> /* basename() */ | |
58 | #include <search.h> /* hsearch_r() */ | |
59 | @@ -337,6 +337,9 @@ void parse_insserv_parse_service(char *s | |
60 | *(buf->ptr++) = ' '; | |
61 | } | |
62 | ||
63 | +/* Forward declaration */ | |
64 | +void parse_insserv_file(const char *restrict file); | |
65 | + | |
66 | void parse_insserv() | |
67 | { | |
68 | parse_insserv_file(PATH_INSSERV); | |
69 | @@ -355,8 +358,10 @@ void parse_insserv() | |
70 | int r; | |
71 | ||
72 | r = snprintf(&buf[0], sizeof(buf), "%s/%s", PATH_INSSERV".d", namelist[n]->d_name); | |
73 | - if (r >= (int)sizeof(buf) || r < 0) | |
74 | - error("snprintf(): %s\n", strerror(errno)); | |
75 | + if (r >= (int)sizeof(buf) || r < 0) { | |
76 | + fprintf(stderr, "snprintf(): %s\n", strerror(errno)); | |
77 | + exit(errno); | |
78 | + } | |
79 | parse_insserv_file(buf); | |
80 | ||
81 | free(namelist[n]); |