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 | |
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')
-rw-r--r-- | lib/libarchive/archive_platform.h | 5 | ||||
-rw-r--r-- | lib/libarchive/archive_util.c | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/libarchive/archive_platform.h b/lib/libarchive/archive_platform.h index 0f651e8..2decf20 100644 --- a/lib/libarchive/archive_platform.h +++ b/lib/libarchive/archive_platform.h @@ -49,7 +49,7 @@ #define HAVE_CHFLAGS 1 #define HAVE_LUTIMES 1 #define HAVE_LCHMOD 1 -#define HAVE_POSIX_STRERROR_R 1 +#define HAVE_STRERROR_R 1 #define ARCHIVE_ERRNO_FILE_FORMAT EFTYPE #define ARCHIVE_ERRNO_PROGRAMMER EINVAL #define ARCHIVE_ERRNO_MISC (-1) @@ -86,7 +86,8 @@ #define st_atimespec st_atim #define st_mtimespec st_mtim #define st_ctimespec st_ctim -#define HAVE_GLIBC_STRERROR_R 1 +#define HAVE_STRERROR_R 1 +#define STRERROR_R_CHAR_P 1 #endif /* 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); |