wolfsshd: retry select() on EINTR in relay loop

SIGCHLD from the exec child interrupts select(), returning -1 and
breaking the loop. Any windowFull data awaiting a peer window adjust
was then abandoned, causing intermittent 32 KB truncations on large
exec transfers. Continue on EINTR.
pull/1001/head
John Safranek 2026-05-18 16:59:32 -07:00 committed by Paul Adelsbach
parent 13db37b1b4
commit 094c686142
1 changed files with 7 additions and 1 deletions

View File

@ -1543,8 +1543,14 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh,
}
rc = select((int)maxFd + 1, &readFds, &writeFds, NULL, NULL);
if (rc == -1)
if (rc == -1) {
/* Signal (e.g. SIGCHLD from child exit) interrupted select.
* Re-evaluate the loop condition so any pending windowFull
* data and remaining pipe contents still get drained. */
if (errno == EINTR)
continue;
break;
}
}
else {
pending = 1; /* found some pending SSH data */