From 29503c5b99cf614550d751391b0ccbec553a8787 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Sat, 23 Jan 2021 14:10:11 +1100 Subject: [PATCH] lib: Fix the build on FreeBSD Commit 7d0981f5e78bc881ca6521932379c69604c33a38 broke the build on FreeBSD: [1589/3917] Compiling lib/util/util_runcmd.c ../../lib/util/util_runcmd.c:310:7: warning: implicit declaration of function 'WIFEXITED' is invalid in C99 [-Wimplicit-function-declaration] if (WIFEXITED(status)) { ^ ../../lib/util/util_runcmd.c:311:13: warning: implicit declaration of function 'WEXITSTATUS' is invalid in C99 [-Wimplicit-function-declaration] status = WEXITSTATUS(status); ^ ../../lib/util/util_runcmd.c:312:14: warning: implicit declaration of function 'WIFSIGNALED' is invalid in C99 [-Wimplicit-function-declaration] } else if (WIFSIGNALED(status)) { ^ ../../lib/util/util_runcmd.c:313:13: warning: implicit declaration of function 'WTERMSIG' is invalid in C99 [-Wimplicit-function-declaration] status = WTERMSIG(status); ^ 4 warnings generated. [1590/3917] Linking bin/default/source4/dsdb/libsamdb-common-samba4.so ld: error: undefined symbol: WIFEXITED >>> referenced by util_runcmd.c >>> lib/util/util_runcmd.c.94.o:(samba_runcmd_io_handler) ld: error: undefined symbol: WEXITSTATUS >>> referenced by util_runcmd.c >>> lib/util/util_runcmd.c.94.o:(samba_runcmd_io_handler) ld: error: undefined symbol: WIFSIGNALED >>> referenced by util_runcmd.c >>> lib/util/util_runcmd.c.94.o:(samba_runcmd_io_handler) ld: error: undefined symbol: WTERMSIG >>> referenced by util_runcmd.c >>> lib/util/util_runcmd.c.94.o:(samba_runcmd_io_handler) clang: error: linker command failed with exit code 1 (use -v to see invocation) Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Mon Jan 25 09:48:09 UTC 2021 on sn-devel-184 --- lib/util/util_runcmd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util/util_runcmd.c b/lib/util/util_runcmd.c index ce2db35d223..ea2e8eead0e 100644 --- a/lib/util/util_runcmd.c +++ b/lib/util/util_runcmd.c @@ -27,6 +27,7 @@ #include "replace.h" #include "system/filesys.h" +#include "system/wait.h" #include #include "lib/util/samba_util.h" #include "lib/util/debug.h"