Skip to content

Commit 8c9eaf8

Browse files
targosaduh95
authored andcommitted
src: initialize FSReqWrapSync in path that uses it
PR-URL: #56613 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent c5ca15b commit 8c9eaf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_file.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,6 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
23832383
}
23842384
} else { // write(fd, string, pos, enc, undefined, ctx)
23852385
CHECK_EQ(argc, 6);
2386-
FSReqWrapSync req_wrap_sync;
23872386
FSReqBase::FSReqBuffer stack_buffer;
23882387
if (buf == nullptr) {
23892388
if (!StringBytes::StorageSize(isolate, value, enc).To(&len))
@@ -2397,6 +2396,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
23972396
buf = *stack_buffer;
23982397
}
23992398
uv_buf_t uvbuf = uv_buf_init(buf, len);
2399+
FSReqWrapSync req_wrap_sync("write");
24002400
FS_SYNC_TRACE_BEGIN(write);
24012401
int bytesWritten = SyncCall(env, args[5], &req_wrap_sync, "write",
24022402
uv_fs_write, fd, &uvbuf, 1, pos);

0 commit comments

Comments
 (0)