diff options
author | Jon Moss <me@jonathanmoss.me> | 2018-07-25 21:15:10 -0400 |
---|---|---|
committer | Jon Moss <me@jonathanmoss.me> | 2018-07-27 22:56:15 -0400 |
commit | 51a50a09f0d01f7fa6fa3ee1f4b8f40504487d6c (patch) | |
tree | 8facdbfdcd40ab29c15b5e59d06dad0fa416acbc /src/node_file.cc | |
parent | bade0fedcdd0db1148d840eaa17d7dbed2511bf7 (diff) | |
download | node-new-51a50a09f0d01f7fa6fa3ee1f4b8f40504487d6c.tar.gz |
src: use available ReqWrap instance for libuv req
Use available `ReqWrap` descendant to make call to libuv -- avoid doing
call with the `ReqWrap`'s request member and then calling `Dispatched()`
afterwards.
PR-URL: https://github.com/nodejs/node/pull/21980
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r-- | src/node_file.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 8414a22ad4..17a44dd784 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1552,9 +1552,12 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) { len = StringBytes::Write(env->isolate(), *stack_buffer, len, args[1], enc); stack_buffer.SetLengthAndZeroTerminate(len); uv_buf_t uvbuf = uv_buf_init(*stack_buffer, len); - int err = uv_fs_write(env->event_loop(), req_wrap_async->req(), - fd, &uvbuf, 1, pos, AfterInteger); - req_wrap_async->Dispatched(); + int err = req_wrap_async->Dispatch(uv_fs_write, + fd, + &uvbuf, + 1, + pos, + AfterInteger); if (err < 0) { uv_fs_t* uv_req = req_wrap_async->req(); uv_req->result = err; |