Re: [PATCH] Fix openreadnclose failing if errno was nonzero before
Just to be sure, I released skalibs-2.5.1.1, so there's a stable version with that bug fixed. Update: the 2.5.1.0 bug breaks s6-rc-update pretty badly, so upgrading to skalibs-2.5.1.1 is highly recommended. -- Laurent
Re: [PATCH] Fix openreadnclose failing if errno was nonzero before
Just to be sure, I released skalibs-2.5.1.1, so there's a stable version with that bug fixed. -- Laurent
Re: [PATCH] Fix openreadnclose failing if errno was nonzero before
On Mon, 22 May 2017 00:44:28 + "Laurent Bercot" wrote: > Does this bug manifest in serious ways, for instance making a s6 > program > fail when it should not? If it does, I'll need to release a new > skalibs version just for this >.> I didn't notice it from a s6 program, but from anopa where e.g. aa-status would fail since it tries to read e.g. fd-notification before calling s6_svstatus_read(), so when the file doesn't exist the later call would fail. I didn't notice issues w/ s6 programs, but as soon as I fixed this I recompiled everything (execline, s6, etc) to avoid any issues, so I didn't look further.
Re: [PATCH] Fix openreadnclose failing if errno was nonzero before
+ errno = 0 ; Ack! Of course. Applied with a minor style change. (I like to keep declaring variables at the start of a block.) Thanks! Does this bug manifest in serious ways, for instance making a s6 program fail when it should not? If it does, I'll need to release a new skalibs version just for this >.> -- Laurent
[PATCH] Fix openreadnclose failing if errno was nonzero before
Signed-off-by: Olivier Brunel --- 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 @@ -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