From 427130e2cadfe349aca8d44b922979e8491f9a74 Mon Sep 17 00:00:00 2001 From: "andrey.bychkov" Date: Wed, 5 Aug 2026 12:48:40 +0300 Subject: [PATCH] fix 2 --- libs/main/core/piwaitevent_p.cpp | 2 +- libs/main/io_devices/piethernet.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/main/core/piwaitevent_p.cpp b/libs/main/core/piwaitevent_p.cpp index 2e07f073..dfb2b23c 100644 --- a/libs/main/core/piwaitevent_p.cpp +++ b/libs/main/core/piwaitevent_p.cpp @@ -90,11 +90,11 @@ bool PIWaitEvent::wait(int fd, CheckRole role) { FD_SET(fd, &(fds[CheckExeption])); if (fd_index != CheckExeption) FD_SET(fd, &(fds[fd_index])); int sr = ::select(nfds, &(fds[CheckRead]), &(fds[CheckWrite]), &(fds[CheckExeption]), nullptr); + if (sr < 0) return false; int buf = 0; while (::read(pipe_fd[ReadEnd], &buf, sizeof(buf)) > 0) ; // piCout << "wait result" << sr << FD_ISSET(fd, &(fds[CheckExeption])) << FD_ISSET(fd, &(fds[fd_index])); - if (sr < 0) return false; if (errno == EBADF || errno == EINTR) return false; if (FD_ISSET(fd, &(fds[CheckExeption]))) return true; return FD_ISSET(fd, &(fds[fd_index])); diff --git a/libs/main/io_devices/piethernet.cpp b/libs/main/io_devices/piethernet.cpp index a28da44f..ad4a08b3 100644 --- a/libs/main/io_devices/piethernet.cpp +++ b/libs/main/io_devices/piethernet.cpp @@ -104,7 +104,7 @@ PIString getSockAddr(sockaddr * s) { if (!s) return PIString(); char buf[INET_ADDRSTRLEN]; - memset(&buf, 0, INET_ADDRSTRLEN); + piZeroMemory(buf, sizeof(buf)); const char * r = inet_ntop(AF_INET, &((sockaddr_in *)s)->sin_addr, buf, sizeof(buf)); return r ? PIStringAscii(r) : PIString(); }