summaryrefslogtreecommitdiff
path: root/ctdb/tests/src
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-06-19 10:35:04 +0200
committerJeremy Allison <jra@samba.org>2018-07-10 20:31:13 +0200
commit93f61639a64f0b3156437b75c31330aa189d3db7 (patch)
treea5780040369ff7028875acc027a44f06372c07a7 /ctdb/tests/src
parentb12f6c6f76440788cadda1fca4fe30531301f668 (diff)
downloadsamba-93f61639a64f0b3156437b75c31330aa189d3db7.tar.gz
ctdb: close the correct pipe fd in a test
This was discovered in an autobuild with a patched tevent that used the "poll" backend by default. Test failure: $ bin/sock_daemon_test /dev/shm/sock_daemon_test.pid /dev/shm/sock_daemon_test.sock 5 test5[28011]: daemon started, pid=28011 test5[28011]: listening on /dev/shm/sock_daemon_test.sock sock_daemon_test: ../ctdb/tests/src/sock_daemon_test.c:980: test5: Assertion `ret == i+1' failed. Abgebrochen (Speicherabzug geschrieben) metze@SERNOX14:~/devel/samba/4.0/master4-test$ test5[28011]: PID 28010 gone away, exiting test5[28011]: Shutting down sock_daemon_test: ../ctdb/tests/src/sock_daemon_test.c:964: test5: Assertion `ret == EINTR' failed. After an epic debugging session we spotted the problem. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'ctdb/tests/src')
-rw-r--r--ctdb/tests/src/sock_daemon_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ctdb/tests/src/sock_daemon_test.c b/ctdb/tests/src/sock_daemon_test.c
index 916ba2236f0..80004b41c91 100644
--- a/ctdb/tests/src/sock_daemon_test.c
+++ b/ctdb/tests/src/sock_daemon_test.c
@@ -759,7 +759,7 @@ static int test5_client(const char *sockpath, int id, pid_t pid_server,
tevent_loop_once(ev);
}
- close(fd[0]);
+ close(fd[1]);
state.fd = -1;
while (kill(pid_server, 0) == 0 || errno != ESRCH) {