Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 67768 | Differences between
and this patch

Collapse All | Expand All

(-)beagle-0.0.8.1.old/glue/inotify-glue.c (-6 / +9 lines)
Lines 85-104 Link Here
85
inotify_glue_watch (int fd, const char *filename, __u32 mask)
85
inotify_glue_watch (int fd, const char *filename, __u32 mask)
86
{
86
{
87
	struct inotify_watch_request iwr;
87
	struct inotify_watch_request iwr;
88
	__s32 wd;
88
	int file_fd, wd;
89
89
90
	iwr.mask = mask;
90
	file_fd = open (filename, O_RDONLY);
91
	iwr.name = strdup (filename);
91
	if (file_fd < 0) {
92
	if (!iwr.name) {
92
		perror ("open");
93
		perror ("strdup");
94
		return -1;
93
		return -1;
95
	}
94
	}
96
95
96
	iwr.fd = file_fd;
97
	iwr.mask = mask;
98
97
	wd = ioctl (fd, INOTIFY_WATCH, &iwr);
99
	wd = ioctl (fd, INOTIFY_WATCH, &iwr);
98
	if (wd < 0)
100
	if (wd < 0)
99
		perror ("ioctl");
101
		perror ("ioctl");
100
102
101
	free (iwr.name);
103
	if (close (file_fd))
104
		perror ("close");
102
105
103
	return wd;
106
	return wd;
104
}
107
}
(-)beagle-0.0.8.1.old/glue/inotify.h (-1 / +1 lines)
Lines 30-36 Link Here
30
 * Pass to the inotify device via the INOTIFY_WATCH ioctl
30
 * Pass to the inotify device via the INOTIFY_WATCH ioctl
31
 */
31
 */
32
struct inotify_watch_request {
32
struct inotify_watch_request {
33
	char		*name;		/* filename name */
33
	int		fd		/* fd of filename to watch */
34
	__u32		mask;		/* event mask */
34
	__u32		mask;		/* event mask */
35
};
35
};
36
36

Return to bug 67768