From db3fcdc5153e89db328244576cb339df9734ada2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 22 May 2017 00:40:25 +0000 Subject: Fix openreadnclose failing if errno was nonzero before (thanks jjk) --- src/libstddjb/openreadnclose.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/libstddjb/openreadnclose.c b/src/libstddjb/openreadnclose.c index aa61ece..57a9bdc 100644 --- a/src/libstddjb/openreadnclose.c +++ b/src/libstddjb/openreadnclose.c @@ -7,7 +7,9 @@ static ssize_t readnclose (int fd, char *s, size_t n) { - size_t r = allread(fd, s, n) ; + size_t r ; + errno = 0 ; + r = allread(fd, s, n) ; if (errno) { int e = errno ; -- cgit v1.2.3