1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-20 20:26:51 +00:00

Add unlisten for linux.

This commit is contained in:
Calvin Rose 2024-08-18 06:25:25 -07:00
parent 33f55dc32f
commit e53d22fad2

View File

@ -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); 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 #elif JANET_WINDOWS
#define WATCHFLAG_RECURSIVE 0x100000u #define WATCHFLAG_RECURSIVE 0x100000u