? .deps ? .libs ? Makefile ? Makefile.in ? bluez-utils-better-inotify-error.patch ? test_textfile Index: notify-inotify.c =================================================================== RCS file: /cvsroot/bluez/utils/common/notify-inotify.c,v retrieving revision 1.8 diff -u -p -r1.8 notify-inotify.c --- notify-inotify.c 16 Feb 2007 20:18:37 -0000 1.8 +++ notify-inotify.c 4 Oct 2007 15:23:55 -0000 @@ -60,14 +60,21 @@ static gboolean io_event(GIOChannel *cha memset(buf, 0, sizeof(buf)); err = g_io_channel_read(chan, (gchar *) buf, sizeof(buf) - 1, &len); - if (err == G_IO_ERROR_AGAIN) + if (err == G_IO_STATUS_AGAIN) { return TRUE; + } else if (err != G_IO_STATUS_NORMAL) { + error("Error reading from channel: No error given"); + return FALSE; + } while (len >= sizeof(struct inotify_event)) { struct inotify_event *evt = (struct inotify_event *) ptr; - if (evt->wd != wd || !callback) + if (evt->wd != wd || !callback) { + len -= sizeof(struct inotify_event) + evt->len; + ptr += sizeof(struct inotify_event) + evt->len; continue; + } if (evt->mask & (IN_CREATE | IN_MOVED_TO)) callback(NOTIFY_CREATE, evt->name, NULL);