From 59682e618805701f9c249736514df6db457895f9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Jan 2005 12:19:25 +0000 Subject: * Make lock removal safe by signalling to blocked processes that the lock they are waiting on has become stale (we do this by writing a meaningless token to the unlinked file). --- src/libutil/util.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libutil/util.cc') diff --git a/src/libutil/util.cc b/src/libutil/util.cc index e77009321d8d..0af6ee149bae 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -415,6 +415,15 @@ bool AutoCloseFD::isOpen() } +/* Pass responsibility for closing this fd to the caller. */ +int AutoCloseFD::borrow() +{ + int oldFD = fd; + fd = -1; + return oldFD; +} + + void Pipe::create() { int fds[2]; -- cgit 1.4.1