Re: syslog_r() should use strerror_r()

2016-10-19 Thread Alexander Bluhm
On Wed, Oct 19, 2016 at 09:52:13AM -0600, Todd C. Miller wrote: > On Wed, 19 Oct 2016 09:11:36 -0600, "Todd C. Miller" wrote: > > > Currently, syslog_r() avoids using strerror() since it is not > > reentrant. We have a reentrant strerror_r() so let's use it. > > Since strerror_r() always fills

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Alexander Bluhm
On Wed, Oct 19, 2016 at 09:34:16AM -0600, Theo de Raadt wrote: > Inside strerror_r, I'm unsure why there is a save_errno dance. That is from the time when we had national language support. ok? bluhm Index: lib/libc/string/strerror_r.c

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 09:11:36 -0600, "Todd C. Miller" wrote: > Currently, syslog_r() avoids using strerror() since it is not > reentrant. We have a reentrant strerror_r() so let's use it. Since strerror_r() always fills in the buffer there is no need to check the return value. If saved_errno is

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 09:34:16 -0600, "Theo de Raadt" wrote: > Inside strerror_r, I'm unsure why there is a save_errno dance. I don't see anything called by strerror_r() that would touch errno so we could get rid of the save_errno dance and just do: if (ret_errno) errno =

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
On Wed, 19 Oct 2016 17:29:18 +0200, Mark Kettenis wrote: > Perhaps add a comment explicitly stating that OpenBSD's strerror_r() > *is* reentrant? I thought that was implicit in the name. - todd

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Theo de Raadt
> > Currently, syslog_r() avoids using strerror() since it is not > > reentrant. We have a reentrant strerror_r() so let's use it. > > > > OK? > > Perhaps add a comment explicitly stating that OpenBSD's strerror_r() > *is* reentrant? Also, signal-handler safe. We've done something a little

Re: syslog_r() should use strerror_r()

2016-10-19 Thread Mark Kettenis
> From: "Todd C. Miller" > Date: Wed, 19 Oct 2016 09:11:36 -0600 > > Currently, syslog_r() avoids using strerror() since it is not > reentrant. We have a reentrant strerror_r() so let's use it. > > OK? Perhaps add a comment explicitly stating that OpenBSD's

syslog_r() should use strerror_r()

2016-10-19 Thread Todd C. Miller
Currently, syslog_r() avoids using strerror() since it is not reentrant. We have a reentrant strerror_r() so let's use it. OK? - todd Index: lib/libc/gen/syslog_r.c === RCS file: /cvs/src/lib/libc/gen/syslog_r.c,v retrieving