Skip to content

Commit 64eeac5

Browse files
fix compiler error (#5821)
1 parent b921af6 commit 64eeac5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/coroutine/hook.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,10 @@ ssize_t swoole_coroutine_read(int sockfd, void *buf, size_t count) {
255255
}
256256

257257
ssize_t ret = -1;
258-
NetSocket sock{
259-
.fd = sockfd,
260-
.nonblock = 1,
261-
.read_timeout = -1,
262-
};
258+
NetSocket sock = {};
259+
sock.fd = sockfd;
260+
sock.nonblock = 1;
261+
sock.read_timeout = -1;
263262
async([&]() { ret = sock.read_sync(buf, count); });
264263
return ret;
265264
}
@@ -275,11 +274,10 @@ ssize_t swoole_coroutine_write(int sockfd, const void *buf, size_t count) {
275274
}
276275

277276
ssize_t ret = -1;
278-
NetSocket sock{
279-
.fd = sockfd,
280-
.nonblock = 1,
281-
.write_timeout = -1,
282-
};
277+
NetSocket sock = {};
278+
sock.fd = sockfd;
279+
sock.nonblock = 1;
280+
sock.write_timeout = -1;
283281
async([&]() { ret = sock.write_sync(buf, count); });
284282
return ret;
285283
}

0 commit comments

Comments
 (0)