From d655a64b5b848342d9c5f5ba314a5d38c3ea1772 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 May 2007 13:49:01 +1000 Subject: [PATCH] kill the lockwait child if the pipe goes away (This used to be ctdb commit bdfa8ba9932fade074a05a6cb6bc14ae3b84618c) --- ctdb/common/ctdb_lockwait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ctdb/common/ctdb_lockwait.c b/ctdb/common/ctdb_lockwait.c index 470d89d1199..22cff9d6b54 100644 --- a/ctdb/common/ctdb_lockwait.c +++ b/ctdb/common/ctdb_lockwait.c @@ -131,7 +131,9 @@ struct lockwait_handle *ctdb_lockwait(struct ctdb_db_context *ctdb_db, close(result->fd[0]); tdb_chainlock(ctdb_db->ltdb->tdb, key); write(result->fd[1], &c, 1); - pause(); + /* this read will exit when the parent closes its end + of the pipe, or the parent dies */ + read(result->fd[1], &c, 1); _exit(0); }