Make udev_deleter not linux-only and fix freebsd build
This commit is contained in:
parent
4e25871655
commit
ce1da5a178
|
|
@ -5,9 +5,7 @@
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <sys/inotify.h>
|
#include <sys/inotify.h>
|
||||||
#include "util/udev_deleter.hpp"
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -18,6 +16,7 @@
|
||||||
#include "ALabel.hpp"
|
#include "ALabel.hpp"
|
||||||
#include "bar.hpp"
|
#include "bar.hpp"
|
||||||
#include "util/sleeper_thread.hpp"
|
#include "util/sleeper_thread.hpp"
|
||||||
|
#include "util/udev_deleter.hpp"
|
||||||
|
|
||||||
namespace waybar::modules {
|
namespace waybar::modules {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <spdlog/spdlog.h>
|
|
||||||
#include <libudev.h>
|
#include <libudev.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
#include <spdlog/spdlog.h>
|
||||||
#include <sys/signalfd.h>
|
#include <sys/signalfd.h>
|
||||||
|
|
||||||
waybar::modules::Battery::Battery(const std::string& id, const Bar& bar, const Json::Value& config)
|
waybar::modules::Battery::Battery(const std::string& id, const Bar& bar, const Json::Value& config)
|
||||||
|
|
@ -23,7 +23,8 @@ waybar::modules::Battery::Battery(const std::string& id, const Bar& bar, const J
|
||||||
if (udev_ == nullptr) {
|
if (udev_ == nullptr) {
|
||||||
throw std::runtime_error("udev_new failed");
|
throw std::runtime_error("udev_new failed");
|
||||||
}
|
}
|
||||||
mon_ = std::unique_ptr<udev_monitor, util::UdevMonitorDeleter>(udev_monitor_new_from_netlink(udev_.get(), "kernel"));
|
mon_ = std::unique_ptr<udev_monitor, util::UdevMonitorDeleter>(
|
||||||
|
udev_monitor_new_from_netlink(udev_.get(), "kernel"));
|
||||||
if (mon_ == nullptr) {
|
if (mon_ == nullptr) {
|
||||||
throw std::runtime_error("udev monitor new failed");
|
throw std::runtime_error("udev monitor new failed");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#include "util/backlight_backend.hpp"
|
#include "util/backlight_backend.hpp"
|
||||||
#include "util/udev_deleter.hpp"
|
|
||||||
|
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
#include <spdlog/spdlog.h>
|
#include <spdlog/spdlog.h>
|
||||||
|
|
@ -9,6 +8,8 @@
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "util/udev_deleter.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class FileDescriptor {
|
class FileDescriptor {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue