From 58d0221ddc5f31940355887a3ca0512b55b82793 Mon Sep 17 00:00:00 2001 From: Balazs Racz Date: Fri, 29 Oct 2021 21:03:55 +0200 Subject: [PATCH] Fix bug in TempFile::rewrite. --- src/os/TempFile.hxx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/TempFile.hxx b/src/os/TempFile.hxx index ee3100836..0b9a30ac9 100644 --- a/src/os/TempFile.hxx +++ b/src/os/TempFile.hxx @@ -117,6 +117,7 @@ public: /// the data to write. void rewrite(const string& s) { ::lseek(fd_, 0, SEEK_SET); + ::ftruncate(fd_, 0); write(s); }