Remove dead code (LSTAT)

main
Luis Díaz Más 3 years ago
parent 798cf9baeb
commit c0b663b7ea

@ -443,42 +443,11 @@ namespace Exiv2 {
mode_t origStMode = 0;
char* pf = const_cast<char*>(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<char*>(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)

@ -313,7 +313,6 @@ void Exiv2::dumpLibraryInfo(std::ostream& os,const std::vector<std::regex>& 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<std::regex>& 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<std::regex>& 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 );

Loading…
Cancel
Save