Add fix for O_NONBLOCK file-descriptor as output pipe
If the output of an fd is a pipe with O_NONBLOCK set, the script will die as soon as the pipe fills up due to the write call returning with EAGAIN. This fixes that. Signed-off-by: Tyrolyean <tyrolyean@tyrolyean.net>
This commit is contained in:
parent
4123b78a81
commit
be8f7d1716
1 changed files with 1 additions and 1 deletions
|
@ -51,7 +51,7 @@ static int write_retry(int fd, const void *buffer, size_t size)
|
||||||
int ret = write(fd, buffer, size);
|
int ret = write(fd, buffer, size);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (errno == EINTR)
|
if (errno == EINTR || errno == EAGAIN)
|
||||||
continue;
|
continue;
|
||||||
perror("write");
|
perror("write");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue