[patch] Add logrotate support

Jim Meyering jim at meyering.net
Mon Jul 11 20:51:31 UTC 2011


Pete Zaitcev wrote:
> On Fri, 08 Jul 2011 14:59:56 +0200
> Jim Meyering <jim at meyering.net> wrote:
>
>> Note that we must not use strerror in a multi-threaded environment
>> since it is not thread-safe []
>
> How is strerror not thread-safe? It's one of those stupid things
> that standards are made of. One silly man somewhere decided to
> create these messages on the fly and store them in a static
> buffer. Voila, now it's not thread-safe. But everyone else
> has all these messages pre-loaded and just returns pointers
> into these arrays.

Hi Pete,

It may be thread-safe for most inputs on most modern systems, but
thread-related bugs (esp. anything that bites only when you emit a
relatively unlikely diagnostic) are hard enough to diagnose that it's
well worth using the guaranteed-by-POSIX safer strerror_r function or
something like error just to avoid the possibility.

Besides, what about the strings like "Unknown error 244" that
you get for values are not in the table?

Jim


More information about the iwhd-devel mailing list