c++17: drop experimental::filesystem
Use the real filesystem library, and drop support for building with
experimental under c++14.
Change-Id: I47cbfc30b223db9dc28e9536ceb84e9fe3342e96
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/ubi/watch.cpp b/ubi/watch.cpp
index fd2cad2..9cbed5d 100644
--- a/ubi/watch.cpp
+++ b/ubi/watch.cpp
@@ -11,7 +11,7 @@
#include <cstddef>
#include <cstring>
-#include <experimental/filesystem>
+#include <filesystem>
#include <functional>
#include <stdexcept>
#include <string>
@@ -24,7 +24,6 @@
{
using namespace phosphor::logging;
-namespace fs = std::experimental::filesystem;
Watch::Watch(sd_event* loop,
std::function<void(const std::string&)> functionalCallback) :
@@ -33,9 +32,9 @@
{
// Create PNOR_ACTIVE_PATH if doesn't exist.
- if (!fs::is_directory(PNOR_ACTIVE_PATH))
+ if (!std::filesystem::is_directory(PNOR_ACTIVE_PATH))
{
- fs::create_directories(PNOR_ACTIVE_PATH);
+ std::filesystem::create_directories(PNOR_ACTIVE_PATH);
}
wd = inotify_add_watch(fd(), PNOR_ACTIVE_PATH, IN_CREATE);
@@ -90,9 +89,9 @@
auto event = reinterpret_cast<inotify_event*>(&buffer[offset]);
// Update the functional association on a RO
// active image symlink change
- fs::path path(PNOR_ACTIVE_PATH);
+ std::filesystem::path path(PNOR_ACTIVE_PATH);
path /= event->name;
- if (fs::equivalent(path, PNOR_RO_ACTIVE_PATH))
+ if (std::filesystem::equivalent(path, PNOR_RO_ACTIVE_PATH))
{
auto id = ItemUpdaterUbi::determineId(path);
static_cast<Watch*>(userdata)->functionalCallback(id);