Set the inotify fd to non-blocking and read file changes
This commit is contained in:
parent
1d6319e928
commit
2b683cb169
2 changed files with 20 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
|||
#include <GLFW/glfw3.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/inotify.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "renderer.h"
|
||||
|
@ -25,6 +26,8 @@ int main(int argc, char *argv[]) {
|
|||
perror("inotify_init");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
/* Set the inotify file descriptor to be non-blocking */
|
||||
fcntl(state.inotify_fd, F_SETFL, O_NONBLOCK);
|
||||
|
||||
state.screen_shader.filename = argv[1];
|
||||
state.screen_shader.wd =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue