summaryrefslogtreecommitdiff
path: root/src/lib/util.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-09-29 23:28:57 +0200
committerCarl Hetherington <cth@carlh.net>2019-10-08 20:16:13 +0200
commit93e89bd463bd51de6823a6796288f6283f885b06 (patch)
tree9dd40b4023688b5624d2688eb16c23adb92b337e /src/lib/util.cc
parent7ba1a973a8d06df646961c11dc34f73bd7141834 (diff)
Improve OpenFileError so that it doesn't say "opening for read"
in one case where it should say "opening for read/write". Also add some unit tests for ReelWriter.
Diffstat (limited to 'src/lib/util.cc')
-rw-r--r--src/lib/util.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc
index 340af1ea8..a17ac54f5 100644
--- a/src/lib/util.cc
+++ b/src/lib/util.cc
@@ -471,7 +471,7 @@ digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
while (i < int64_t (files.size()) && to_do > 0) {
FILE* f = fopen_boost (files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, true);
+ throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
}
boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));
@@ -491,7 +491,7 @@ digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
while (i >= 0 && to_do > 0) {
FILE* f = fopen_boost (files[i], "rb");
if (!f) {
- throw OpenFileError (files[i].string(), errno, true);
+ throw OpenFileError (files[i].string(), errno, OpenFileError::READ);
}
boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));