Rev 297: kill the lockwait child if the pipe goes away in	http://samba.org/~tridge/ctdb ------------------------------------------------------------
revno: 297
revision-id: tridge@samba.org-20070514034901-vpwg24spu188ab97
parent: tridge@samba.org-20070514034840-njb68t1bfrmcbhtl
committer: Andrew Tridgell 
branch nick: tridge
timestamp: Mon 2007-05-14 13:49:01 +1000
message:
  kill the lockwait child if the pipe goes away
modified:
  common/ctdb_lockwait.c         ctdb_lockwait.c-20070416214118-n1aeonljj3vpdd9q-1
=== modified file 'common/ctdb_lockwait.c'
--- a/common/ctdb_lockwait.c	2007-05-05 07:19:59 +0000
+++ b/common/ctdb_lockwait.c	2007-05-14 03:49:01 +0000
@@ -131,7 +131,9 @@
 		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);
 	}
 

