MCPcopy Create free account
hub / github.com/Icinga/icinga2 / CollectPaths

Method CollectPaths

lib/remote/configpackageutility.cpp:338–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void ConfigPackageUtility::CollectPaths(const String& path, std::vector<std::pair<String, bool> >& paths)
339{
340#ifndef _WIN32
341 struct stat statbuf;
342 int rc = lstat(path.CStr(), &statbuf);
343 if (rc < 0)
344 BOOST_THROW_EXCEPTION(posix_error()
345 << boost::errinfo_api_function("lstat")
346 << boost::errinfo_errno(errno)
347 << boost::errinfo_file_name(path));
348
349 paths.emplace_back(path, S_ISDIR(statbuf.st_mode));
350#else /* _WIN32 */
351 struct _stat statbuf;
352 int rc = _stat(path.CStr(), &statbuf);
353 if (rc < 0)
354 BOOST_THROW_EXCEPTION(posix_error()
355 << boost::errinfo_api_function("_stat")
356 << boost::errinfo_errno(errno)
357 << boost::errinfo_file_name(path));
358
359 paths.emplace_back(path, ((statbuf.st_mode & S_IFMT) == S_IFDIR));
360#endif /* _WIN32 */
361}
362
363bool ConfigPackageUtility::ContainsDotDot(const String& path)
364{

Callers

nothing calls this directly

Calls 3

posix_errorClass · 0.85
CStrMethod · 0.80
_statClass · 0.70

Tested by

no test coverage detected