1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

use strerror() to generate error message

as suggested by @terrelln .

also:
- hopefully fixed Windows version
- changed the test, so that it passes on non-english OS stdlib errors.
This commit is contained in:
Yann Collet
2018-12-20 09:16:40 -08:00
parent de4eb06a77
commit 105fa953cb
3 changed files with 23 additions and 18 deletions

View File

@ -24,8 +24,12 @@ extern "C" {
int UTIL_fileExist(const char* filename)
{
stat_t statbuf;
int const stat_success = stat(filename, &statbuf);
return !stat_success;
#if defined(_MSC_VER)
int const stat_error = _stat64(filename, &statbuf);
#else
int const stat_error = stat(filename, &statbuf);
#endif
return !stat_error;
}
int UTIL_isRegularFile(const char* infilename)