]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
kill the lockwait child if the pipe goes away
authorAndrew Tridgell <tridge@samba.org>
Mon, 14 May 2007 03:49:01 +0000 (13:49 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 14 May 2007 03:49:01 +0000 (13:49 +1000)
(This used to be ctdb commit bdfa8ba9932fade074a05a6cb6bc14ae3b84618c)

ctdb/common/ctdb_lockwait.c

index 470d89d1199db67b4ed039bb87ded1e4b2224e76..22cff9d6b54707bfbffa15acb27939acdbb3b834 100644 (file)
@@ -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);
        }