From b796b0f37b9ee40e4767636dffb9345d339c5a3c Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Thu, 3 Nov 2022 20:49:33 +0300 Subject: [PATCH] hurd compatibility changes Hurd does not define PIPE_BUF, so lib/tevent/testsuite.c fails to compile (yes, this file is used as part of *samba* testsuite, not tevent testsuite). Define it to a safe minimal value like 512 bytes. Hurd does not provide SA_NOCLDWAIT define, so lib/util/tests/tfork.c does not compile. This is only needed during testing to omit zombie process generation, which has only cosmetic effect. Define it to be 0. Based on prior work and ideas by Samuel Thibault. Gbp-Pq: Name hurd-compat.patch --- lib/tevent/testsuite.c | 4 ++++ lib/util/tests/tfork.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c index 040e0039..21553023 100644 --- a/lib/tevent/testsuite.c +++ b/lib/tevent/testsuite.c @@ -37,6 +37,10 @@ #include "system/threads.h" #include #endif +#include +#ifndef PIPE_BUF /* eg hurd does not define it */ +# define PIPE_BUF 512 /* a safe bet */ +#endif static struct tevent_context * test_tevent_context_init(TALLOC_CTX *mem_ctx) diff --git a/lib/util/tests/tfork.c b/lib/util/tests/tfork.c index 19237a51..86e4fa7a 100644 --- a/lib/util/tests/tfork.c +++ b/lib/util/tests/tfork.c @@ -33,6 +33,9 @@ #ifdef HAVE_PTHREAD #include #endif +#ifndef SA_NOCLDWAIT +#define SA_NOCLDWAIT 0 +#endif static bool test_tfork_simple(struct torture_context *tctx) { -- 2.30.2