[patch] Add logrotate support

Jim Meyering jim at meyering.net
Tue Jul 12 11:45:34 UTC 2011


Pete Zaitcev wrote:

> On Fri, 08 Jul 2011 14:59:56 +0200
> Jim Meyering <jim at meyering.net> wrote:
>
>>   +		error(_("Failed to open log file %s: %s\n"),
>>   +		      path, strerror(errno));
>>
>> the two leading integer arguments to "error" (usu. "0, 0,") have
>> been omitted.  I would expect gcc -Wformat to catch that.
>
> Perhaps this explains why:
>
>> #define error(status, err, fmt, args...) log_msg(LOG_ERR, fmt, ##args)

No.  That just discards the first two arguments to "error(..."
We don't want to discard the format string and first additional arg.

> Personally, I am against such insiduous obfuscation by redefining
> library functions. We out to comb the source and replace calls
> to error() with calls to log_msg.

Redefining like that is useful as a first-cut patch;
it is non-invasive and shows how mechanical the eventual change would be.


More information about the iwhd-devel mailing list