diff -ur beagle-0.0.8.1.old/glue/inotify-glue.c beagle-0.0.8.1/glue/inotify-glue.c --- beagle-0.0.8.1.old/glue/inotify-glue.c 2005-04-06 18:02:33.000000000 -0400 +++ beagle-0.0.8.1/glue/inotify-glue.c 2005-04-06 18:04:54.000000000 -0400 @@ -85,20 +85,23 @@ inotify_glue_watch (int fd, const char *filename, __u32 mask) { struct inotify_watch_request iwr; - __s32 wd; + int file_fd, wd; - iwr.mask = mask; - iwr.name = strdup (filename); - if (!iwr.name) { - perror ("strdup"); + file_fd = open (filename, O_RDONLY); + if (file_fd < 0) { + perror ("open"); return -1; } + iwr.fd = file_fd; + iwr.mask = mask; + wd = ioctl (fd, INOTIFY_WATCH, &iwr); if (wd < 0) perror ("ioctl"); - free (iwr.name); + if (close (file_fd)) + perror ("close"); return wd; } diff -ur beagle-0.0.8.1.old/glue/inotify.h beagle-0.0.8.1/glue/inotify.h --- beagle-0.0.8.1.old/glue/inotify.h 2005-04-06 18:02:33.000000000 -0400 +++ beagle-0.0.8.1/glue/inotify.h 2005-04-06 18:06:04.000000000 -0400 @@ -30,7 +30,7 @@ * Pass to the inotify device via the INOTIFY_WATCH ioctl */ struct inotify_watch_request { - char *name; /* filename name */ + int fd /* fd of filename to watch */ __u32 mask; /* event mask */ };