diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/file_log.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/file_log.cc b/src/lib/file_log.cc index 5cc9c5569..4d6a0e6ea 100644 --- a/src/lib/file_log.cc +++ b/src/lib/file_log.cc @@ -69,7 +69,11 @@ FileLog::head_and_tail (int amount) const uintmax_t head_amount = amount; uintmax_t tail_amount = amount; - uintmax_t size = boost::filesystem::file_size (_file); + boost::system::error_code ec; + uintmax_t size = boost::filesystem::file_size (_file, ec); + if (size == static_cast<uintmax_t>(-1)) { + return ""; + } if (size < (head_amount + tail_amount)) { head_amount = size; |
