summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2018-11-14 15:13:03 -0700
committerJeremy Allison <jra@samba.org>2018-11-16 21:52:13 +0100
commitbe46a42774590f68f8560d82f8425a43fecda98b (patch)
tree7db287cbea416ea90b38b9fc7d2fe75c20e23ff0
parent579ce3eb4e5b14159cfe20d00f0ba7e4801f2944 (diff)
downloadsamba-be46a42774590f68f8560d82f8425a43fecda98b.tar.gz
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 <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 16 21:52:13 CET 2018 on sn-devel-144
-rw-r--r--source4/torture/smb2/oplock.c2
1 files changed, 2 insertions, 0 deletions
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. */