Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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);
- Loading branch information