void lutro_deinit() { #ifdef HAVE_INOTIFY if (settings.live_enable) lutro_live_deinit(); #endif lua_close(L); }
void lutro_live_init() { memset(&live, 0, sizeof(live)); live.ifd = inotify_init1(IN_NONBLOCK); if (live.ifd < 0) { perror("Failed to initialize inotify"); lutro_live_deinit(); return; } // XXX: Some editors do not trigger IN_MODIFY since they write to a temp file // and rename() it to the actual file. live.wfd = inotify_add_watch(live.ifd, settings.gamedir, IN_MODIFY|IN_MOVED_TO); if (live.wfd < 0) { perror("Failed to monitor game directory"); lutro_live_deinit(); return; } }