Don't loop over read/write, recv/send or tcgetpgrp/tcsetpgrp trying
to handle EINTR. We now use SA_RESTART with signals so this is not needed and is potentially dangerous if it is possible to receive SIGTTIN or SIGTTOU (which it currently is not).
This commit is contained in:
@@ -73,13 +73,10 @@ errpipe_cb(int fd, int what, void *v)
|
||||
* Read errno from child or EOF when command is executed.
|
||||
* Note that the error pipe is *blocking*.
|
||||
*/
|
||||
do {
|
||||
nread = read(fd, &errval, sizeof(errval));
|
||||
} while (nread == -1 && errno == EINTR);
|
||||
|
||||
nread = read(fd, &errval, sizeof(errval));
|
||||
switch (nread) {
|
||||
case -1:
|
||||
if (errno != EAGAIN) {
|
||||
if (errno != EAGAIN && errno != EINTR) {
|
||||
if (ec->cstat->val == CMD_INVALID) {
|
||||
/* XXX - need a way to distinguish non-exec error. */
|
||||
ec->cstat->type = CMD_ERRNO;
|
||||
|
Reference in New Issue
Block a user