From 31fb2e22a0b0c73d494cec6e788d93c3a425d314 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 8 Feb 2023 21:12:07 +0100 Subject: [PATCH] src: add fflush() to SnapshotData::ToFile() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs: https://github.com/nodejs/node/pull/46491#discussion_r1097610165 PR-URL: https://github.com/nodejs/node/pull/46531 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca --- src/node_snapshotable.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_snapshotable.cc b/src/node_snapshotable.cc index de398ab6261d88..40971cf8fd28b3 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -866,6 +866,7 @@ void SnapshotData::ToFile(FILE* out) const { const std::vector sink = ToBlob(); size_t num_written = fwrite(sink.data(), sink.size(), 1, out); CHECK_EQ(num_written, 1); + CHECK_EQ(fflush(out), 0); } const SnapshotData* SnapshotData::FromEmbedderWrapper(