diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-05-22 00:40:25 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-05-22 00:40:25 +0000 |
commit | db3fcdc5153e89db328244576cb339df9734ada2 (patch) | |
tree | fc0819d067580374ef5c8b74ad3f60b2861a5a5a /src/libstddjb | |
parent | e83b1d8245b7ca716bd6896c5a2725de7d7e9141 (diff) | |
download | skalibs-db3fcdc5153e89db328244576cb339df9734ada2.tar.xz |
Fix openreadnclose failing if errno was nonzero before (thanks jjk)
Diffstat (limited to 'src/libstddjb')
-rw-r--r-- | src/libstddjb/openreadnclose.c | 4 |
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 ; |