From be8f7d1716024894a67b10cc290b18c1a430e5ae Mon Sep 17 00:00:00 2001 From: Tyrolyean Date: Sun, 17 Jul 2022 20:03:32 +0200 Subject: [PATCH] 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 --- shadermeh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadermeh.c b/shadermeh.c index f02054c..dccc65b 100644 --- a/shadermeh.c +++ b/shadermeh.c @@ -51,7 +51,7 @@ static int write_retry(int fd, const void *buffer, size_t size) int ret = write(fd, buffer, size); if (ret < 0) { - if (errno == EINTR) + if (errno == EINTR || errno == EAGAIN) continue; perror("write"); return -1;