perror: Avoid clobbering the strerror buffer when possible.
authorBruno Haible <bruno@clisp.org>
Thu, 19 May 2011 19:49:01 +0000 (21:49 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 19 May 2011 19:49:01 +0000 (21:49 +0200)
commit30f176b6e12f1a67070991ee7ac505f2fa8a605c
treef2dbb7e3407b9365ff218a86524e637299892b0b
parentb79d34835799d78d05b99916bfc363850905601c
perror: Avoid clobbering the strerror buffer when possible.

* lib/strerror-impl.h: New file, extracted from lib/strerror.c.
* lib/strerror.c: Include it.
* modules/strerror (Files): Add lib/strerror-impl.h.
* lib/perror.c: Include <stdlib.h>, intprops.h, verify.h.
(my_strerror): New function, defined through lib/strerror-impl.h.
(perror): Use it instead of strerror.
* modules/perror (Files): Add lib/strerror-impl.h.
(Depends-on): Remove strerror. Add intprops, verify, strerror_r-posix.
ChangeLog
lib/perror.c
lib/strerror-impl.h [new file with mode: 0644]
lib/strerror.c
modules/perror
modules/strerror