diff options
author | kientzle <kientzle@FreeBSD.org> | 2004-03-22 05:17:23 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2004-03-22 05:17:23 +0000 |
commit | 30025170bd09677e4ca4b99594b84574fef3ad97 (patch) | |
tree | 94b9394276c4bd512329671e4b6fc116267d40cf /lib/libarchive/archive_util.c | |
parent | fd4191a431a9d48462ae7bf97479dfeb60811408 (diff) | |
download | FreeBSD-src-30025170bd09677e4ca4b99594b84574fef3ad97.zip FreeBSD-src-30025170bd09677e4ca4b99594b84574fef3ad97.tar.gz |
Just use autoconf-compatible feature macros; don't try to be clever.
Diffstat (limited to 'lib/libarchive/archive_util.c')
-rw-r--r-- | lib/libarchive/archive_util.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libarchive/archive_util.c b/lib/libarchive/archive_util.c index 11d151a..52c591d 100644 --- a/lib/libarchive/archive_util.c +++ b/lib/libarchive/archive_util.c @@ -83,7 +83,9 @@ void archive_set_error(struct archive *a, int error_number, const char *fmt, ...) { va_list ap; +#ifdef HAVE_STRERROR_R char errbuff[512]; +#endif char *errp; a->archive_error_number = error_number; @@ -96,11 +98,13 @@ archive_set_error(struct archive *a, int error_number, const char *fmt, ...) archive_string_vsprintf(&(a->error_string), fmt, ap); if(error_number > 0) { archive_strcat(&(a->error_string), ": "); -#if defined(HAVE_GLIBC_STRERROR_R) +#ifdef HAVE_STRERROR_R +#ifdef STRERROR_R_CHAR_P errp = strerror_r(error_number, errbuff, sizeof(errbuff)); -#elif defined(HAVE_POSIX_STRERROR_R) +#else strerror_r(error_number, errbuff, sizeof(errbuff)); errp = errbuff; +#endif #else /* Note: this is not threadsafe! */ errp = strerror(error_number); |