diff --git a/src/basicio.cpp b/src/basicio.cpp index b189462e..8a179518 100644 --- a/src/basicio.cpp +++ b/src/basicio.cpp @@ -443,42 +443,11 @@ namespace Exiv2 { mode_t origStMode = 0; char* pf = const_cast(path().c_str()); - // Get the permissions of the file, or linked-to file, on platforms which have lstat -#ifdef EXV_HAVE_LSTAT - - struct stat buf1; - if (::lstat(pf, &buf1) == -1) { - statOk = false; -#ifndef SUPPRESS_WARNINGS - EXV_WARNING << Error(kerCallFailed, pf, strError(), "::lstat") << "\n"; -#endif - } - origStMode = buf1.st_mode; - DataBuf lbuf; // So that the allocated memory is freed. Must have same scope as pf - // In case path() is a symlink, get the path of the linked-to file - if (statOk && S_ISLNK(buf1.st_mode)) { - lbuf.alloc(buf1.st_size + 1); - lbuf.clear(); - pf = reinterpret_cast(lbuf.data()); - if (::readlink(path().c_str(), pf, lbuf.size() - 1) == -1) { - throw Error(kerCallFailed, path(), strError(), "readlink"); - } - // We need the permissions of the file, not the symlink - if (::stat(pf, &buf1) == -1) { - statOk = false; -#ifndef SUPPRESS_WARNINGS - EXV_WARNING << Error(kerCallFailed, pf, strError(), "::stat") << "\n"; -#endif - } - origStMode = buf1.st_mode; - } -#else // EXV_HAVE_LSTAT Impl::StructStat buf1; if (p_->stat(buf1) == -1) { statOk = false; } origStMode = buf1.st_mode; -#endif // !EXV_HAVE_LSTAT { #if defined(WIN32) && defined(REPLACEFILE_IGNORE_MERGE_ERRORS) diff --git a/src/version.cpp b/src/version.cpp index 5576a0a8..907feecc 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -313,7 +313,6 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const std::vector& keys int have_lensdata =0; int have_iconv =0; int have_memory =0; - int have_lstat =0; int have_stdbool =0; int have_stdint =0; int have_stdlib =0; @@ -362,10 +361,6 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const std::vector& keys have_memory=1; #endif -#ifdef EXV_HAVE_LSTAT - have_lstat=1; -#endif - #ifdef EXV_HAVE_STDBOOL_H have_stdbool=1; #endif @@ -492,7 +487,6 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const std::vector& keys output(os,keys,"have_lensdata" ,have_lensdata ); output(os,keys,"have_iconv" ,have_iconv ); output(os,keys,"have_memory" ,have_memory ); - output(os,keys,"have_lstat" ,have_lstat ); output(os,keys,"have_stdbool" ,have_stdbool ); output(os,keys,"have_stdint" ,have_stdint ); output(os,keys,"have_stdlib" ,have_stdlib );