do not block when reading inotify_fd
authorPhil Sutter <phil@nwl.cc>
Sun, 20 Sep 2009 15:48:55 +0000 (17:48 +0200)
committerPhil Sutter <phil@nwl.cc>
Sun, 20 Sep 2009 17:04:45 +0000 (19:04 +0200)
Originally, I was experiencing sporadic lockups when reading inotify_fd;
which is strange, since it is protected by select(). This should fix it
despite of the original problem.

src/conky.c

index 4eb5741..51d307f 100644 (file)
@@ -6712,7 +6712,7 @@ int main(int argc, char **argv)
 #endif /* XOAP */
 
 #ifdef HAVE_SYS_INOTIFY_H
-       inotify_fd = inotify_init();
+       inotify_fd = inotify_init1(IN_NONBLOCK);
 #endif /* HAVE_SYS_INOTIFY_H */
 
        initialisation(argc, argv);