[cpp-xmltooling] branch master updated: Avoid spurious error when object is empty.
Scott Cantor
cantor.2 at osu.edu
Tue Apr 10 21:39:07 EDT 2018
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository cpp-xmltooling.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-xmltooling.git;a=commit;h=4132014879ec89c2b1efc9fe10422020e923a4b6
The following commit(s) were added to refs/heads/master by this push:
new 4132014 Avoid spurious error when object is empty.
4132014 is described below
commit 4132014879ec89c2b1efc9fe10422020e923a4b6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 10 21:38:50 2018 -0400
Avoid spurious error when object is empty.
---
xmltooling/security/impl/ManagedResource.h | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/xmltooling/security/impl/ManagedResource.h b/xmltooling/security/impl/ManagedResource.h
index 60be7ee..e995df2 100644
--- a/xmltooling/security/impl/ManagedResource.h
+++ b/xmltooling/security/impl/ManagedResource.h
@@ -56,18 +56,20 @@ namespace xmltooling {
public:
bool stale(logging::Category& log, RWLock* lock=nullptr) {
if (local) {
+ if (source.empty())
+ return false;
#ifdef WIN32
struct _stat stat_buf;
- if (_stat(source.c_str(), &stat_buf) != 0) {
- log.error("unable to stat local resource (%s)", source.c_str());
- return false;
- }
+ if (_stat(source.c_str(), &stat_buf) != 0) {
+ log.error("unable to stat local resource (%s)", source.c_str());
+ return false;
+ }
#else
- struct stat stat_buf;
- if (stat(source.c_str(), &stat_buf) != 0) {
- log.error("unable to stat local resource (%s)", source.c_str());
- return false;
- }
+ struct stat stat_buf;
+ if (stat(source.c_str(), &stat_buf) != 0) {
+ log.error("unable to stat local resource (%s)", source.c_str());
+ return false;
+ }
#endif
if (filestamp >= stat_buf.st_mtime)
return false;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list