]> granicus.if.org Git - icinga2/commitdiff
Fix including a non-existing directory exception requires path information.
authorMichael Friedrich <michael.friedrich@netways.de>
Fri, 7 Feb 2014 12:23:26 +0000 (13:23 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 7 Feb 2014 12:23:26 +0000 (13:23 +0100)
Fixes #5618

lib/base/utility.cpp

index d8025d6d0678a3a69f56d9d70c62a48384267ce6..7070c918de87b77b1081f8f1b2e536c54b81fe63 100644 (file)
@@ -472,7 +472,8 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
        if (dirp == NULL)
                BOOST_THROW_EXCEPTION(posix_error()
                    << boost::errinfo_api_function("opendir")
-                   << boost::errinfo_errno(errno));
+                   << boost::errinfo_errno(errno)
+                   << boost::errinfo_file_name(path));
 
        while (dirp) {
                dirent ent, *pent;
@@ -482,7 +483,8 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
 
                        BOOST_THROW_EXCEPTION(posix_error()
                            << boost::errinfo_api_function("readdir_r")
-                           << boost::errinfo_errno(errno));
+                           << boost::errinfo_errno(errno)
+                           << boost::errinfo_file_name(path));
                }
 
                if (!pent)
@@ -500,7 +502,8 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
 
                        BOOST_THROW_EXCEPTION(posix_error()
                            << boost::errinfo_api_function("lstat")
-                           << boost::errinfo_errno(errno));
+                           << boost::errinfo_errno(errno)
+                           << boost::errinfo_file_name(cpath));
                }
 
                if (S_ISDIR(statbuf.st_mode))
@@ -511,7 +514,8 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
 
                        BOOST_THROW_EXCEPTION(posix_error()
                            << boost::errinfo_api_function("stat")
-                           << boost::errinfo_errno(errno));
+                           << boost::errinfo_errno(errno)
+                           << boost::errinfo_file_name(cpath));
                }
 
                if (!S_ISDIR(statbuf.st_mode) && !S_ISREG(statbuf.st_mode))