comparison src/core/filesystem.cc @ 402:d859306e2db4 default tip

filesystem: actually check for inotify instead of blindly assuming it exists
author Paper <paper@tflc.us>
date Fri, 07 Nov 2025 18:36:18 -0500
parents 2f89797b6a44
children
comparison
equal deleted inserted replaced
401:2f89797b6a44 402:d859306e2db4
6 6
7 #include <filesystem> 7 #include <filesystem>
8 8
9 #ifdef WIN32 9 #ifdef WIN32
10 # include <windows.h> 10 # include <windows.h>
11 #elif defined(linux) 11 #elif defined(HAVE_INOTIFY)
12 /* ehhhh */ 12 /* ehhhh */
13 # include <fcntl.h> 13 # include <fcntl.h>
14 # include <unistd.h> 14 # include <unistd.h>
15 # include <sys/inotify.h> 15 # include <sys/inotify.h>
16 #endif 16 #endif
366 OVERLAPPED overlapped_; 366 OVERLAPPED overlapped_;
367 alignas(FILE_NOTIFY_INFORMATION) char change_buf_[4096]; 367 alignas(FILE_NOTIFY_INFORMATION) char change_buf_[4096];
368 }; 368 };
369 369
370 using DefaultWatcher = Win32WatcherVista; 370 using DefaultWatcher = Win32WatcherVista;
371 #elif defined(__linux__) 371 #elif defined(HAVE_INOTIFY)
372 /* Inotify watcher */ 372 /* Inotify watcher */
373 class InotifyWatcher : public StdFilesystemWatcher { 373 class InotifyWatcher : public StdFilesystemWatcher {
374 public: 374 public:
375 InotifyWatcher(void *opaque, const std::filesystem::path &path, IWatcher::EventHandler handler, bool recursive) 375 InotifyWatcher(void *opaque, const std::filesystem::path &path, IWatcher::EventHandler handler, bool recursive)
376 : StdFilesystemWatcher(opaque, path, handler, recursive) 376 : StdFilesystemWatcher(opaque, path, handler, recursive)