306 {
308 uv_fs_event_t &uv_handle = *fsWatch.uv_handle_;
309 const uv_status initStatus = uv_fs_event_init(loop.uvloop(), &uv_handle);
310 if (initStatus != 0) {
311 throw UvcoException{
312 initStatus,
313 "uv_fs_event_init returned error while initializing FsWatch"};
314 }
315 const auto startStatus =
316 callWithNullTerminated<uv_status>(path, [&](std::string_view safePath) {
318 flags);
319 });
320 if (startStatus != 0) {
321 uv_fs_event_stop(&uv_handle);
322
324 fsWatch.uv_handle_.reset();
325 throw UvcoException{
326 startStatus, "uv_fs_event_start returned error while starting FsWatch"};
327 }
328 co_return fsWatch;
329}
static void onFsWatcherEvent(uv_fs_event_t *handle, const char *path, int events, uv_status status)
Definition fs.cc:359
FsWatch()
Definition fs.cc:283
int uv_status
Result of a libuv operation, an errno error code.
Definition internal_utils.h:22