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.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 9d8e4afed..fe4fedfa5 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -224,12 +224,12 @@ string readFile(int fd)
}
-string readFile(const Path & path)
+string readFile(const Path & path, bool drain)
{
AutoCloseFD fd = open(path.c_str(), O_RDONLY);
if (fd == -1)
throw SysError(format("opening file `%1%'") % path);
- return readFile(fd);
+ return drain ? drainFD(fd) : readFile(fd);
}