From: Christof Schmitt Date: Wed, 14 Nov 2018 22:13:03 +0000 (-0700) Subject: smbtorture: Close unused pipe fds in kernel_oplocks8 X-Git-Tag: tdb-1.3.17~747 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be46a42774590f68f8560d82f8425a43fecda98b;p=thirdparty%2Fsamba.git smbtorture: Close unused pipe fds in kernel_oplocks8 This fixes a hang of the testcase when hitting an error in the child (e.g. localdir does not exist) Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Nov 16 21:52:13 CET 2018 on sn-devel-144 --- diff --git a/source4/torture/smb2/oplock.c b/source4/torture/smb2/oplock.c index 800a4cf299f..8bbb641ea72 100644 --- a/source4/torture/smb2/oplock.c +++ b/source4/torture/smb2/oplock.c @@ -4956,12 +4956,14 @@ static bool wait_for_child_oplock(struct torture_context *tctx, char c; /* Parent. */ TALLOC_FREE(name); + close(fds[1]); ret = sys_read(fds[0], &c, 1); torture_assert(tctx, ret == 1, "read failed"); return true; } /* Child process. */ + close(fds[0]); ret = do_child_process(fds[1], name); _exit(ret); /* Notreached. */