From 6357a2501c5d9c275073db7be43f5d115df6dda0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Nov 2014 15:35:19 +0000 Subject: [PATCH] tdb: Fix tdb_runtime_check_for_robust_mutexes() When using exit() instead of _exit(), the child will flush buffered stdout (and other stdio) content that it inherited from the parent process. In make test, this led to duplicate output from net registry which then confused the blackbox selftest. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10968 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- lib/tdb/common/mutex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tdb/common/mutex.c b/lib/tdb/common/mutex.c index bdc4c28..12f89d3 100644 --- a/lib/tdb/common/mutex.c +++ b/lib/tdb/common/mutex.c @@ -814,17 +814,17 @@ _PUBLIC_ bool tdb_runtime_check_for_robust_mutexes(void) ret = pthread_mutex_lock(m); nwritten = write(pipe_up[1], &ret, sizeof(ret)); if (nwritten != sizeof(ret)) { - exit(1); + _exit(1); } if (ret != 0) { - exit(1); + _exit(1); } nread = read(pipe_down[0], &c, 1); if (nread != 1) { - exit(1); + _exit(1); } /* leave locked */ - exit(0); + _exit(0); } if (tdb_robust_mutex_pid == -1) { goto cleanup_sig_child; -- 1.9.1