From e53d22fad26a80000d79de1df67d0e57d33617e3 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 18 Aug 2024 06:25:25 -0700 Subject: [PATCH] Add unlisten for linux. --- src/core/filewatch.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/filewatch.c b/src/core/filewatch.c index c08e1684..a5112be1 100644 --- a/src/core/filewatch.c +++ b/src/core/filewatch.c @@ -257,6 +257,12 @@ static void janet_watcher_listen(JanetWatcher *watcher) { janet_async_start_fiber(fiber, watcher->stream, JANET_ASYNC_LISTEN_READ, watcher_callback_read, watcher); } +static void janet_watcher_unlisten(JanetWatcher *watcher) { + if (!watcher->is_watching) return; + watcher->is_watching = 0; + janet_stream_close(watcher->stream); +} + #elif JANET_WINDOWS #define WATCHFLAG_RECURSIVE 0x100000u