summaryrefslogtreecommitdiff
path: root/src/libstddjb/openreadnclose.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/openreadnclose.c')
-rw-r--r--src/libstddjb/openreadnclose.c4
1 files changed, 3 insertions, 1 deletions
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 ;