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

Commit

Permalink
file: fixing ttd hooks in node_file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
MSLaguana committed Feb 9, 2018
1 parent 96b667d commit f162a30
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,18 @@ void AfterInteger(uv_fs_t* req) {
FSReqWrap* req_wrap = static_cast<FSReqWrap*>(req->data);
FSReqAfterScope after(req_wrap, req);

if (after.Proceed()) {
#if ENABLE_TTD_NODE
if (s_doTTRecord || s_doTTReplay) {
if (req->fs_type == UV_FS_READ && (s_doTTRecord || s_doTTReplay)) {
#ifdef WIN32
byte* bufbase = reinterpret_cast<byte*>(req->fs.info.bufsml[0].base);
byte* bufbase = reinterpret_cast<byte*>(req->fs.info.bufsml[0].base);
#else
byte* bufbase = reinterpret_cast<byte*>(req->bufsml[0].base);
byte* bufbase = reinterpret_cast<byte*>(req->bufsml[0].base);
#endif
Buffer::TTDAsyncModNotify(bufbase + req->result);
}
Buffer::TTDAsyncModNotify(bufbase + req->result);
}
#endif

if (after.Proceed()) {
req_wrap->Resolve(Integer::New(req_wrap->env()->isolate(), req->result));
}
}
Expand Down

0 comments on commit f162a30

Please sign in to comment.