swap pollfds order

This commit is contained in:
2026-06-01 14:40:51 +01:00
parent 12c7abd3b0
commit 3e8640e54f
+4 -4
View File
@@ -244,12 +244,12 @@ int main(int argc, char **argv)
struct pollfd pollfds[2] = {
{
.fd = socket,
.fd = sigpipe_fds[0],
.events = POLLIN,
.revents = 0
},
{
.fd = sigpipe_fds[0],
.fd = socket,
.events = POLLIN,
.revents = 0
},
@@ -259,7 +259,7 @@ int main(int argc, char **argv)
if(poll(pollfds, 2, 10000) == 0)
continue;
if(pollfds[0].revents) {
if(pollfds[1].revents) {
if(find_peer(0)) {
int len = recvmsg(socket, &msg , 0);
if(len <= 0) continue;
@@ -286,7 +286,7 @@ int main(int argc, char **argv)
}
}
if(pollfds[1].revents) {
if(pollfds[0].revents) {
pid_t pid;
int wstatus;