diff options
author | Tobias Brunner <tobias@strongswan.org> | 2012-06-28 12:13:05 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2012-06-28 13:14:52 +0200 |
commit | bbbffac3abe4dbb1c60ba9fa27378a4a8cbe27ee (patch) | |
tree | 234487ac990000980f84e1ab60aa48cfa64d762a /src | |
parent | 2a5952765956192359a0f0b8506c5ec266a6d387 (diff) | |
download | strongswan-bbbffac3abe4dbb1c60ba9fa27378a4a8cbe27ee.tar.bz2 strongswan-bbbffac3abe4dbb1c60ba9fa27378a4a8cbe27ee.tar.xz |
Defined a macro to replace strerror(3) with calls to thread-safe wrapper
Diffstat (limited to 'src')
-rw-r--r-- | src/libstrongswan/utils.c | 2 | ||||
-rw-r--r-- | src/libstrongswan/utils.h | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libstrongswan/utils.c b/src/libstrongswan/utils.c index f613b0c64..8c0c7f46c 100644 --- a/src/libstrongswan/utils.c +++ b/src/libstrongswan/utils.c @@ -254,6 +254,8 @@ const char *safe_strerror(int errnum) return msg; } #else /* HAVE_STRERROR_R */ +/* we actually wan't to call strerror(3) below */ +#undef strerror /* * Described in header. */ diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h index 954925dab..c671a2e08 100644 --- a/src/libstrongswan/utils.h +++ b/src/libstrongswan/utils.h @@ -422,6 +422,11 @@ bool mkdir_p(const char *path, mode_t mode); */ const char *safe_strerror(int errnum); +/** + * Replace usages of strerror(3) with thread-safe variant. + */ +#define strerror(errnum) safe_strerror(errnum) + #ifndef HAVE_CLOSEFROM /** * Close open file descriptors greater than or equal to lowfd. |