From 6bf9c882a484d225718bf97389e27f0346ec9a22 Mon Sep 17 00:00:00 2001 From: Richard Hodges Date: Fri, 10 Dec 2021 17:06:38 +0100 Subject: [PATCH] Fix open append mode for file_posix --- CHANGELOG.md | 1 + include/boost/beast/core/impl/file_posix.ipp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e4f6a61..4e917e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Fix open append mode for file_posix. * Fix open append mode for file_win32. * Add tests for file open in append mode. * Fix file open with append/append_existing flag on Windows. diff --git a/include/boost/beast/core/impl/file_posix.ipp b/include/boost/beast/core/impl/file_posix.ipp index 1bb7ae10..e8fa900e 100644 --- a/include/boost/beast/core/impl/file_posix.ipp +++ b/include/boost/beast/core/impl/file_posix.ipp @@ -165,7 +165,7 @@ open(char const* path, file_mode mode, error_code& ec) break; case file_mode::append: - f = O_WRONLY | O_CREAT | O_TRUNC; + f = O_WRONLY | O_CREAT | O_APPEND; #if BOOST_BEAST_USE_POSIX_FADVISE advise = POSIX_FADV_SEQUENTIAL; #endif