diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-27 12:19:25 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-27 12:19:25 +0000 |
commit | 59682e618805701f9c249736514df6db457895f9 (patch) | |
tree | 4a66762d4dffe3d37ed84c13bd0d2c314275b233 /src/libutil/util.cc | |
parent | a24b78e9f1a7326badb6c38d5d63aeb6ccdf9970 (diff) | |
download | guix-59682e618805701f9c249736514df6db457895f9.tar.gz |
* 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).
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r-- | src/libutil/util.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index e77009321d..0af6ee149b 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]; |