Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.sbin/rtadvd



On Friday 03 July 2015 19:28:26 David Holland wrote:
> On Fri, Jul 03, 2015 at 08:12:42PM +0100, Roy Marples wrote:
>  > >> Modified Files:
>  > >> 	src/usr.sbin/rtadvd: advcap.c if.c rrenum.c rtadvd.c
>  > >> 
>  > >> Log Message:
>  > >> Use %m in syslog(3) instead of %s strerror(3).
>  > > 
>  > > Was this really necessary? Last I remember we considered %m a legacy
>  > > mistake and preferred to avoid it.
>  > 
>  > It made the program smaller, which is a good thing.
>  > There is no mention of syslog %m being considered a legacy mistake
>  > in the man page. Maybe you have a link to any discussion of this?
> 
> I'm not sure I'm going to be able to find it readily. Searching for %m
> doesn't work real well, even with grep.
> 
> however, here's what it's about. %m is a wart: since it's not part of
> printf, it means you can't use printf to implement syslog(3), at least
> not without adding a bunch of gross hacks.

This I do agree with after implementing a syslog wrapper in dhcpcd.

> Or alternatively (like the
> gnu folks do) you can quietly add %m support to printf, which is
> pretty gross as well.

I'm on the fence about that.
I dislike it's not standard (but hey, we have our own non standard stuff too!) 
but is is convenient.

But aside from not being a standard, but is wrong with %m in printf?

> There is no real reason %m is necessary and we were at least
> discussing deprecating it; I don't think anything formal came of that
> but still it's probably better not to add new uses of it.
> 
> anyone else remember? Christos?

Is it necessary? No it's not.
However it *is* a convenience, saves code size and is an accepted standard
http://pubs.opengroup.org/onlinepubs/7908799/xsh/closelog.html

Roy


Home | Main Index | Thread Index | Old Index