Skip to content

Commit

Permalink
use older inotify interface for back compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pacew committed Dec 3, 2009
1 parent a71509e commit 955436b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion img.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <memory.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/inotify.h>


#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>

Expand Down Expand Up @@ -223,11 +225,13 @@ main (int argc, char **argv)

gtk_widget_show (window);

if ((inotify_fd = inotify_init1 (IN_NONBLOCK | IN_CLOEXEC)) < 0) {
if ((inotify_fd = inotify_init ()) < 0) {
fprintf (stderr, "error doing inotify_init\n");
exit (1);
}

fcntl (inotify_fd, F_SETFL, O_NONBLOCK | O_EXCL);

g_io_add_watch (g_io_channel_unix_new (inotify_fd), G_IO_IN,
inotify_handler, NULL);

Expand Down

0 comments on commit 955436b

Please sign in to comment.