|
|
@ -69,7 +69,7 @@ namespace Exiv2 {
|
|
|
|
bool fileExists(const std::string& path, bool ct)
|
|
|
|
bool fileExists(const std::string& path, bool ct)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct stat buf;
|
|
|
|
struct stat buf;
|
|
|
|
int ret = ::stat(path.c_str(), &buf);
|
|
|
|
int ret = ::stat(path.c_str(), &buf);
|
|
|
|
if (0 != ret) return false;
|
|
|
|
if (0 != ret) return false;
|
|
|
|
if (ct && !S_ISREG(buf.st_mode)) return false;
|
|
|
|
if (ct && !S_ISREG(buf.st_mode)) return false;
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -104,6 +104,9 @@ namespace Exiv2 {
|
|
|
|
strerror_r(error, buf, n);
|
|
|
|
strerror_r(error, buf, n);
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
os << buf;
|
|
|
|
os << buf;
|
|
|
|
|
|
|
|
// Issue# 908.
|
|
|
|
|
|
|
|
// report strerror() if strerror_r() returns empty
|
|
|
|
|
|
|
|
if ( !buf[0] ) os << strerror(error);
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
os << std::strerror(error);
|
|
|
|
os << std::strerror(error);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|