1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

fix: Initialize the local variable properly.

- Make sure `pollfd::revents` is initialized.
This commit is contained in:
Dicot0721 2025-01-17 16:05:19 +08:00
parent da60684b9f
commit 1ed65ee9f4

View File

@ -515,9 +515,11 @@ Socket* ListenSocket::Accept()
struct sockaddr_storage remote;
socklen_t sz = sizeof( remote );
struct pollfd fd;
fd.fd = (socket_t)m_sock;
fd.events = POLLIN;
struct pollfd fd
{
.fd = (socket_t)m_sock,
.events = POLLIN
};
if( poll( &fd, 1, 10 ) > 0 )
{