Skip to content

Commit 94f687e

Browse files
committed
Fix FTBFS on GNU Hurd: define _GNU_SOURCE so unistd.h declares pipe2.
FAILED: src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o cc -Isrc/start-stop-daemon/start-stop-daemon.p -Isrc/start-stop-daemon -I../src/start-stop-daemon -Isrc/shared -I../src/shared -Isrc/libeinfo -I../src/libeinfo -Isrc/librc -I../src/librc -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=c99 -D_DEFAULT_SOURCE -DMAXPATHLEN=4096 -DPATH_MAX=4096 -Wcast-align -Wcast-qual -Wdeclaration-after-statement -Wformat=2 -Winline -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wsequence-point -Wshadow -Wwrite-strings -Werror=implicit-function-declaration -DHAVE_MALLOC_EXTENDED_ATTRIBUTE -DHAVE_CLOSEFROM -DHAVE_CLOSE_RANGE_CLOEXEC -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -MD -MQ src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o -MF src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o.d -o src/start-stop-daemon/start-stop-daemon.p/start-stop-daemon.c.o -c ../src/start-stop-daemon/start-stop-daemon.c ../src/start-stop-daemon/start-stop-daemon.c: In function ‘main’: ../src/start-stop-daemon/start-stop-daemon.c:865:13: error: implicit declaration of function ‘pipe2’; did you mean ‘pipe’? [-Werror=implicit-function-declaration] 865 | if (pipe2(pipefd, O_CLOEXEC) == -1) | ^~~~~ | pipe Although this is triggered on HURD, according to glibc pipe2(2), this is required for the 2 argument form irresepctive of arch. SYNOPSIS #include <unistd.h> int pipe(int pipefd[2]); #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <fcntl.h> /* Definition of O_* constants */ #include <unistd.h> int pipe2(int pipefd[2], int flags);
1 parent 5cd8e06 commit 94f687e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/start-stop-daemon/start-stop-daemon.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121

2222
#define ONE_MS 1000000
2323

24-
#ifdef __linux__
25-
/* For extra SCHED_* defines. */
24+
/* For extra SCHED_* defines and pipe2. */
2625
# define _GNU_SOURCE
27-
#endif
2826

2927
#include <errno.h>
3028
#include <fcntl.h>

0 commit comments

Comments
 (0)