tread: fix check for EINTR - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
git clone git://r-36.net/geomyidae
Log
Files
Refs
README
LICENSE
---
commit 4388f861d5cc17ef801a399aa31012f5e73e6080
parent d8d4d97f72ab591ac149f563acff1f032e2d60fa
Author: Hiltjo Posthuma 
Date:   Sun,  7 Jun 2020 21:19:50 +0200

read: fix check for EINTR

Signed-off-by: Christoph Lohmann <20h@r-36.net>

Diffstat:
  main.c                              |       2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/main.c b/main.c
t@@ -797,7 +797,7 @@ main(int argc, char *argv[])
                                         close(tlspipe[1]);
                                         do {
                                                 shuflen = read(tlspipe[0], shufbuf, sizeof(shufbuf)-1);
-                                                if (shuflen == EINTR)
+                                                if (shuflen == -1 && errno == EINTR)
                                                         continue;
                                                 for (shufpos = 0; shufpos < shuflen; shufpos += wlen) {
                                                         wlen = tls_write(tlsclientctx, shufbuf+shufpos, shuflen-shufpos);