Defined a macro to replace strerror(3) with calls to thread-safe wrapper

This commit is contained in:
Tobias Brunner 2012-06-28 12:13:05 +02:00
parent 2a59527659
commit bbbffac3ab
2 changed files with 7 additions and 0 deletions

View File

@ -254,6 +254,8 @@ const char *safe_strerror(int errnum)
return msg; return msg;
} }
#else /* HAVE_STRERROR_R */ #else /* HAVE_STRERROR_R */
/* we actually wan't to call strerror(3) below */
#undef strerror
/* /*
* Described in header. * Described in header.
*/ */

View File

@ -422,6 +422,11 @@ bool mkdir_p(const char *path, mode_t mode);
*/ */
const char *safe_strerror(int errnum); const char *safe_strerror(int errnum);
/**
* Replace usages of strerror(3) with thread-safe variant.
*/
#define strerror(errnum) safe_strerror(errnum)
#ifndef HAVE_CLOSEFROM #ifndef HAVE_CLOSEFROM
/** /**
* Close open file descriptors greater than or equal to lowfd. * Close open file descriptors greater than or equal to lowfd.