mirror of
https://github.com/falcosecurity/falco.git
synced 2025-07-17 00:01:52 +00:00
Merge 61532a8004
into 0c12b44bc6
This commit is contained in:
commit
b499cf5665
@ -38,7 +38,9 @@ limitations under the License.
|
|||||||
|
|
||||||
falco::app::restart_handler::~restart_handler() {
|
falco::app::restart_handler::~restart_handler() {
|
||||||
stop();
|
stop();
|
||||||
close(m_inotify_fd);
|
if(m_inotify_fd != -1) {
|
||||||
|
close(m_inotify_fd);
|
||||||
|
}
|
||||||
m_inotify_fd = -1;
|
m_inotify_fd = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +50,12 @@ void falco::app::restart_handler::trigger() {
|
|||||||
|
|
||||||
bool falco::app::restart_handler::start(std::string& err) {
|
bool falco::app::restart_handler::start(std::string& err) {
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
if(m_watched_files.empty() && m_watched_dirs.empty()) {
|
||||||
|
falco_logger::log(falco_logger::level::DEBUG,
|
||||||
|
"Refusing to start restart handler due to nothing to watch\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
m_inotify_fd = inotify_init();
|
m_inotify_fd = inotify_init();
|
||||||
if(m_inotify_fd < 0) {
|
if(m_inotify_fd < 0) {
|
||||||
err = "could not initialize inotify handler";
|
err = "could not initialize inotify handler";
|
||||||
|
@ -61,7 +61,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void watcher_loop() noexcept;
|
void watcher_loop() noexcept;
|
||||||
|
|
||||||
int m_inotify_fd;
|
int m_inotify_fd = -1;
|
||||||
std::thread m_watcher;
|
std::thread m_watcher;
|
||||||
std::atomic<bool> m_stop;
|
std::atomic<bool> m_stop;
|
||||||
std::atomic<bool> m_forced;
|
std::atomic<bool> m_forced;
|
||||||
|
Loading…
Reference in New Issue
Block a user