diff --git a/src/exec.c b/src/exec.c index 383a0c351..9e8021036 100644 --- a/src/exec.c +++ b/src/exec.c @@ -208,7 +208,7 @@ backchannel_cb(int fd, int what, void *v) debug_decl(backchannel_cb, SUDO_DEBUG_EXEC) /* read child status */ - n = recv(fd, ec->cstat, sizeof(struct command_status), 0); + n = recv(fd, ec->cstat, sizeof(struct command_status), MSG_WAITALL); if (n != sizeof(struct command_status)) { if (n == -1) { switch (errno) { diff --git a/src/exec_pty.c b/src/exec_pty.c index 278ec531f..aa55163bc 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -1141,7 +1141,7 @@ mon_backchannel_cb(int fd, int what, void *v) debug_decl(mon_backchannel_cb, SUDO_DEBUG_EXEC); /* read command from backchannel, should be a signal */ - n = recv(fd, &cstmp, sizeof(cstmp), 0); + n = recv(fd, &cstmp, sizeof(cstmp), MSG_WAITALL); if (n != sizeof(cstmp)) { if (n == -1) { if (errno == EINTR || errno == EAGAIN)