X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Futil.c;h=31b51ff41314e0f3d4d96e8435f73dc0418ae974;hp=f915f2fe855b2f67db21e5b0be1365acfd0d943a;hb=2a33c303e30fd740f740e21632fd06b9e414b0c7;hpb=34e8ed1d4d8caf88cb92028a30ce6a51a9120db9 diff --git a/src/util.c b/src/util.c index f915f2fe..31b51ff4 100644 --- a/src/util.c +++ b/src/util.c @@ -3,7 +3,7 @@ */ /* - * Copyright (C) 2012 Eric Biggers + * Copyright (C) 2012, 2013 Eric Biggers * * This file is part of wimlib, a library for working with WIM files. * @@ -21,6 +21,10 @@ * along with wimlib; if not, see http://www.gnu.org/licenses/. */ +#include "config.h" + +#define MINGW_HAS_SECURE_API + #undef _GNU_SOURCE /* Make sure the POSIX-compatible strerror_r() is declared, rather than the GNU * version, which has a different return type. */ @@ -38,6 +42,11 @@ #include /* for getpid() */ +/* Windoze compatibility */ +#ifdef __WIN32__ +# define strerror_r(errnum, buf, bufsize) strerror_s(buf, bufsize, errnum) +#endif + /* True if wimlib is to print an informational message when an error occurs. * This can be turned off by calling wimlib_set_print_errors(false). */ #ifdef ENABLE_ERROR_MESSAGES @@ -54,7 +63,8 @@ static void wimlib_vmsg(const char *tag, const char *format, vfprintf(stderr, format, va); if (perror && errno_save != 0) { char buf[50]; - int res = strerror_r(errno_save, buf, sizeof(buf)); + int res; + res = strerror_r(errno_save, buf, sizeof(buf)); if (res) { snprintf(buf, sizeof(buf), "unknown error (errno=%d)", errno_save); @@ -137,6 +147,9 @@ static const char *error_strings[] = { [WIMLIB_ERR_FUSERMOUNT] = "Could not execute the `fusermount' program, or it exited " "with a failure status", + [WIMLIB_ERR_ICONV_NOT_AVAILABLE] + = "The iconv() function does not seem to work. " + "Maybe check to make sure the directory /usr/lib/gconv exists", [WIMLIB_ERR_IMAGE_COUNT] = "Inconsistent image count among the metadata " "resources, the WIM header, and/or the XML data", @@ -162,17 +175,18 @@ static const char *error_strings[] = { = "The WIM's integrity table is invalid", [WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY] = "An entry in the WIM's lookup table is invalid", + [WIMLIB_ERR_INVALID_OVERLAY] + = "Conflicting files in overlay when creating a WIM image", [WIMLIB_ERR_INVALID_PARAM] = "An invalid parameter was given", [WIMLIB_ERR_INVALID_PART_NUMBER] = "The part number or total parts of the WIM is invalid", [WIMLIB_ERR_INVALID_RESOURCE_HASH] = "The SHA1 message digest of a WIM resource did not match the expected value", - [WIMLIB_ERR_ICONV_NOT_AVAILABLE] - = "The iconv() function does not seem to work. " - "Maybe check to make sure the directory /usr/lib/gconv exists", [WIMLIB_ERR_INVALID_RESOURCE_SIZE] = "A resource entry in the WIM has an invalid size", + [WIMLIB_ERR_INVALID_SECURITY_DATA] + = "The table of security descriptors in the WIM is invalid", [WIMLIB_ERR_INVALID_UNMOUNT_MESSAGE] = "The version of wimlib that has mounted a WIM image is incompatible with the " "version being used to unmount it", @@ -223,6 +237,8 @@ static const char *error_strings[] = { = "The WIM is part of a split WIM, which is not supported for this operation", [WIMLIB_ERR_STAT] = "Could not read the metadata for a file or directory", + [WIMLIB_ERR_TIMEOUT] + = "Timed out while waiting for a message to arrive from another process", [WIMLIB_ERR_UNKNOWN_VERSION] = "The WIM file is marked with an unknown version number", [WIMLIB_ERR_UNSUPPORTED]