inotifi_init1() is not available on older systems
authorPavel Labath <pavelo@centrum.sk>
Mon, 12 Apr 2010 20:40:16 +0000 (22:40 +0200)
committerPavel Labath <pavelo@centrum.sk>
Mon, 12 Apr 2010 20:45:03 +0000 (22:45 +0200)
-> replace with inotify_init() + fcntl()
atomicity should not be important here, since we don't have any threads running at the point of
the call

src/conky.c

index 1254abe..21850b5 100644 (file)
@@ -5944,7 +5944,13 @@ int main(int argc, char **argv)
 #endif /* XOAP */
 
 #ifdef HAVE_SYS_INOTIFY_H
-       inotify_fd = inotify_init1(IN_NONBLOCK);
+       inotify_fd = inotify_init();
+       if(inotify_fd != -1) {
+               int fl;
+
+               fl = fcntl(inotify_fd, F_GETFL);
+               fcntl(inotify_fd, F_SETFL, fl | O_NONBLOCK);
+       }
 #endif /* HAVE_SYS_INOTIFY_H */
 
        initialisation(argc, argv);