Source: openrc
Version: 0.34-1
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
openrc FTBFS on GNU/Hurd due to some minor issues, see below:
* 0009-build-on-hurd.patch: Fix FTBFS on GNU/Hurd
- src/rc/supervise-daemon.c: Add check for SIGPWR
- mk/os-GNU.mk: Add CFLAGS
- src/lsb2rcconf/GNUmakefile: Use CFLAGS
- src/lsb2rcconf/main.c: Replace error() with fprintf() and exit()
The patch is attached.
Thanks!
Index: openrc-0.34/src/rc/supervise-daemon.c
===================================================================
--- openrc-0.34.orig/src/rc/supervise-daemon.c
+++ openrc-0.34/src/rc/supervise-daemon.c
@@ -446,7 +446,9 @@ static void supervisor(char *exec, char
signal_setup_restart(SIGEMT, handle_signal);
#endif
signal_setup_restart(SIGIO, handle_signal);
+#ifdef SIGPWR
signal_setup_restart(SIGPWR, handle_signal);
+#endif
#ifdef SIGUNUSED
signal_setup_restart(SIGUNUSED, handle_signal);
#endif
Index: openrc-0.34/mk/os-GNU.mk
===================================================================
--- openrc-0.34.orig/mk/os-GNU.mk
+++ openrc-0.34/mk/os-GNU.mk
@@ -12,4 +12,5 @@ SFX= .GNU.in
PKG_PREFIX?= /usr
CPPFLAGS+= -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=700 -DMAXPATHLEN=4096 -DPATH_MAX=4096
+CFLAGS+= -DPATH_MAX=4096
LIBDL= -Wl,-Bdynamic -ldl
Index: openrc-0.34/src/lsb2rcconf/GNUmakefile
===================================================================
--- openrc-0.34.orig/src/lsb2rcconf/GNUmakefile
+++ openrc-0.34/src/lsb2rcconf/GNUmakefile
@@ -5,9 +5,12 @@ COMPRESS_MAN ?= yes
STRIP_BINARY ?= yes
#EXAMPLES ?= yes
-STDFLAG ?= -D_BSD_SOURCE
+MK= ../../mk
+include ${MK}/os.mk
+
+STDFLAG ?= -D_DEFAULT_SOURCE
CSECFLAGS ?= -fstack-protector-all -Wall --param ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fstack-check -DPARANOID
-CFLAGS ?= -march=native -pipe -O2 -std=c99
+CFLAGS += -march=native -pipe -O2 -std=c99
CFLAGS += $(CSECFLAGS) $(STDFLAG)
DEBUGCFLAGS ?= -pipe -Wall -Werror -ggdb3 -Wno-error=unused-variable $(CSECFLAGS)
Index: openrc-0.34/src/lsb2rcconf/main.c
===================================================================
--- openrc-0.34.orig/src/lsb2rcconf/main.c
+++ openrc-0.34/src/lsb2rcconf/main.c
@@ -39,9 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE
#define hsearch_data_t struct hsearch_data
#endif
-#include <stdio.h> /* fprintf() */
+#include <stdio.h> /* fprintf(), perror() */
#include <stdlib.h> /* exit() */
-#include <string.h> /* strcmp() */
+#include <string.h> /* strcmp(), strerror() */
#include <errno.h> /* ENVAL */
#include <libgen.h> /* basename() */
#include <search.h> /* hsearch_r() */
@@ -337,6 +337,9 @@ void parse_insserv_parse_service(char *s
*(buf->ptr++) = ' ';
}
+/* Forward declaration */
+void parse_insserv_file(const char *restrict file);
+
void parse_insserv()
{
parse_insserv_file(PATH_INSSERV);
@@ -355,8 +358,10 @@ void parse_insserv()
int r;
r = snprintf(&buf[0], sizeof(buf), "%s/%s", PATH_INSSERV".d", namelist[n]->d_name);
- if (r >= (int)sizeof(buf) || r < 0)
- error("snprintf(): %s\n", strerror(errno));
+ if (r >= (int)sizeof(buf) || r < 0) {
+ fprintf(stderr, "snprintf(): %s\n", strerror(errno));
+ exit(errno);
+ }
parse_insserv_file(buf);
free(namelist[n]);