diff --git a/TransferLogManager.cpp b/TransferLogManager.cpp index 9a7647a2..f61dd068 100644 --- a/TransferLogManager.cpp +++ b/TransferLogManager.cpp @@ -304,6 +304,10 @@ void TransferLogManager::writeEntriesToDisk() { for (const auto &entry : entries) { buffer.append(entry); } + if (buffer.empty()) { + // do not write when there is nothing to write + continue; + } int toWrite = buffer.size(); int written = ::write(fd_, buffer.c_str(), toWrite); if (written != toWrite) {