Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit f162a30

Browse files
committed
file: fixing ttd hooks in node_file
Some refactoring had caused TTD to fail whenever node::fs::AfterInteger was called for a reason other than node::fs::Read. PR-URL: #461 Reviewed-By: Mike Kaufman <mike.kaufman@microsoft.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
1 parent 96b667d commit f162a30

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/node_file.cc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,18 @@ void AfterInteger(uv_fs_t* req) {
211211
FSReqWrap* req_wrap = static_cast<FSReqWrap*>(req->data);
212212
FSReqAfterScope after(req_wrap, req);
213213

214-
if (after.Proceed()) {
215214
#if ENABLE_TTD_NODE
216-
if (s_doTTRecord || s_doTTReplay) {
215+
if (req->fs_type == UV_FS_READ && (s_doTTRecord || s_doTTReplay)) {
217216
#ifdef WIN32
218-
byte* bufbase = reinterpret_cast<byte*>(req->fs.info.bufsml[0].base);
217+
byte* bufbase = reinterpret_cast<byte*>(req->fs.info.bufsml[0].base);
219218
#else
220-
byte* bufbase = reinterpret_cast<byte*>(req->bufsml[0].base);
219+
byte* bufbase = reinterpret_cast<byte*>(req->bufsml[0].base);
221220
#endif
222-
Buffer::TTDAsyncModNotify(bufbase + req->result);
223-
}
221+
Buffer::TTDAsyncModNotify(bufbase + req->result);
222+
}
224223
#endif
224+
225+
if (after.Proceed()) {
225226
req_wrap->Resolve(Integer::New(req_wrap->env()->isolate(), req->result));
226227
}
227228
}

0 commit comments

Comments
 (0)