From 95674360b2545a70f7fd0c551d9205773671a6b4 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 197b67581e095b..0f52046173d06d 100644 --- a/src/node_snapshotable.cc +++ b/src/node_snapshotable.cc @@ -860,6 +860,7 @@ void SnapshotData::ToBlob(FILE* out) const { size_t num_written = fwrite(w.sink.data(), w.sink.size(), 1, out); CHECK_EQ(num_written, 1); w.Debug("SnapshotData::ToBlob() Wrote %d bytes\n", written_total); + CHECK_EQ(fflush(out), 0); } bool SnapshotData::FromBlob(SnapshotData* out, FILE* in) {