From 982120c73e59b229ec29f0ed6d2b2545a9fac732 Mon Sep 17 00:00:00 2001 From: Richard Hodges Date: Tue, 21 Jul 2020 17:38:07 +0200 Subject: [PATCH] Fix file open with append_existing flag on posix fixes #2011 closes #2027 --- 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 31e8f718..86e6a460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ Version XXX: +* Fix file open with append_existing flag on posix. * Websocket SSL `teardown` also tears down underlying TCP. * Update WebSocket examples to set TLS SNI. * Add handler tracking locations to websocket. diff --git a/include/boost/beast/core/impl/file_posix.ipp b/include/boost/beast/core/impl/file_posix.ipp index 0f7f42ac..61a33a52 100644 --- a/include/boost/beast/core/impl/file_posix.ipp +++ b/include/boost/beast/core/impl/file_posix.ipp @@ -172,7 +172,7 @@ open(char const* path, file_mode mode, error_code& ec) break; case file_mode::append_existing: - f = O_WRONLY; + f = O_WRONLY | O_APPEND; #if BOOST_BEAST_USE_POSIX_FADVISE advise = POSIX_FADV_SEQUENTIAL; #endif