Skip to content

Commit

Permalink
Use AC_FUNC_STRERROR_R and STRERROR_R_CHAR_P
Browse files Browse the repository at this point in the history
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
  • Loading branch information
asalkeld committed May 28, 2012
1 parent 7658261 commit fe8014b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions configure.ac
Expand Up @@ -173,6 +173,7 @@ AM_CONDITIONAL(HAVE_SEMUN,
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_MMAP
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([alarm clock_gettime ftruncate gettimeofday \
localtime localtime_r memset munmap socket \
strchr strrchr strdup strerror strstr stpcpy strcasecmp \
Expand Down
4 changes: 2 additions & 2 deletions lib/unix.c
Expand Up @@ -43,14 +43,14 @@
char *
qb_strerror_r(int errnum, char *buf, size_t buflen)
{
#ifdef QB_LINUX
#ifdef STRERROR_R_CHAR_P
return strerror_r(errnum, buf, buflen);
#else
if (strerror_r(errnum, buf, buflen) != 0) {
buf[0] = '\0';
}
return buf;
#endif /* QB_LINUX */
#endif /* STRERROR_R_CHAR_P */
}

static int32_t
Expand Down

0 comments on commit fe8014b

Please sign in to comment.