1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Merge r457 from libarchive.googlecode.com: Stop appending strerror()

information to error strings.  This caused a lot of unnecessary
duplication in error messages; in particular, there are a few cases
where error messages get copied from one archive object to another
and this would cause the strerror() info to get appended each time.
This commit is contained in:
Tim Kientzle 2009-03-06 05:13:12 +00:00
parent a86d4001dd
commit c07eec6459
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189434

View File

@ -155,10 +155,6 @@ 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;
if (fmt == NULL) {
@ -169,21 +165,6 @@ archive_set_error(struct archive *a, int error_number, const char *fmt, ...)
va_start(ap, fmt);
archive_string_vsprintf(&(a->error_string), fmt, ap);
va_end(ap);
if (error_number > 0) {
archive_strcat(&(a->error_string), ": ");
#ifdef HAVE_STRERROR_R
#ifdef STRERROR_R_CHAR_P
errp = strerror_r(error_number, errbuff, sizeof(errbuff));
#else
strerror_r(error_number, errbuff, sizeof(errbuff));
errp = errbuff;
#endif
#else
/* Note: this is not threadsafe! */
errp = strerror(error_number);
#endif
archive_strcat(&(a->error_string), errp);
}
a->error = a->error_string.s;
}