[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:40:30 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=43303cf
The following commit has been merged in the master branch:
commit 43303cf44b5ecd3bed18a907df47399373215bb0
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat May 16 14:59:33 2009 +0000
#633: Apply the fix only for platforms which have lstat. This does not include Win based platforms.
---
config/config.h.in | 3 +++
config/configure.ac | 2 +-
src/basicio.cpp | 17 +++++++++++++----
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/config/config.h.in b/config/config.h.in
index 733f833..4c0c530 100644
--- a/config/config.h.in
+++ b/config/config.h.in
@@ -52,6 +52,9 @@
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
+/* Define to 1 if you have the `lstat' function. */
+#undef HAVE_LSTAT
+
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#undef HAVE_REALLOC
diff --git a/config/configure.ac b/config/configure.ac
index b6f1ff5..704e032 100644
--- a/config/configure.ac
+++ b/config/configure.ac
@@ -87,7 +87,7 @@ AC_SUBST(GCC,$GCC)
#AC_FUNC_MKTIME - fails when using old autoconf with gcc-4.3, see eg. Debian Bug#425544, and we don't use the result anyway
AC_FUNC_MMAP
AC_FUNC_STRERROR_R
-AC_CHECK_FUNCS([gmtime_r memset strchr strerror strtol mmap munmap])
+AC_CHECK_FUNCS([gmtime_r lstat memset mmap munmap strchr strerror strtol])
AC_CHECK_FUNCS([timegm], HAVE_TIMEGM=1)
AC_SUBST(HAVE_TIMEGM,$HAVE_TIMEGM)
diff --git a/src/basicio.cpp b/src/basicio.cpp
index 653e5ce..11763e4 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -233,15 +233,16 @@ namespace Exiv2 {
close();
bool statOk = true;
struct stat buf1;
- if (::lstat(path_.c_str(), &buf1) == -1) {
+ char* pf = const_cast<char*>(path_.c_str());
+#ifdef EXV_HAVE_LSTAT
+ if (::lstat(pf, &buf1) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
- std::cerr << "Warning: " << Error(2, path_, strError(), "lstat") << "
";
+ std::cerr << "Warning: " << Error(2, pf, strError(), "lstat") << "
";
#endif
}
+ 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
- char* pf = const_cast<char*>(path_.c_str());
- DataBuf lbuf;
if (statOk && S_ISLNK(buf1.st_mode)) {
lbuf.alloc(buf1.st_size + 1);
memset(lbuf.pData_, 0x0, lbuf.size_);
@@ -257,6 +258,14 @@ namespace Exiv2 {
#endif
}
}
+#else
+ if (::stat(pf, &buf1) == -1) {
+ statOk = false;
+#ifndef SUPPRESS_WARNINGS
+ std::cerr << "Warning: " << Error(2, pf, strError(), "stat") << "
";
+#endif
+ }
+#endif // !EXV_HAVE_LSTAT
// MSVCRT rename that does not overwrite existing files
if (fileExists(pf) && std::remove(pf) != 0) {
throw Error(2, pf, strError(), "std::remove");
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list