[PATCH] Fix openreadnclose failing if errno was nonzero before

From: Olivier Brunel <jjk_at_jjacky.com>
Date: Sun, 21 May 2017 21:22:19 +0200

Signed-off-by: Olivier Brunel <jjk_at_jjacky.com>
---
 src/libstddjb/openreadnclose.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/src/libstddjb/openreadnclose.c b/src/libstddjb/openreadnclose.c
index aa61ece..39bb3b9 100644
--- a/src/libstddjb/openreadnclose.c
+++ b/src/libstddjb/openreadnclose.c
_at_@ -7,6 +7,7 @@
 
 static ssize_t readnclose (int fd, char *s, size_t n)
 {
+  errno = 0 ;
   size_t r = allread(fd, s, n) ;
   if (errno)
   {
-- 
2.13.0
Received on Sun May 21 2017 - 19:22:19 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC