aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index e77009321..0af6ee149 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];