Re: [gamin] support for inotify 0.18 take 2



On Sat, 2005-01-29 at 10:21 +1100, Jeff Waugh wrote:
> <quote who="John McCutchan">
> 
> > my previous patch had some problems, it was leaking lots of memory. This
> > is an updated version of my previous patch, that fixes the new leaks, and
> > fixes an old leak that was around from the beginning.
> 
> Hi John,
> 
> The previous patch seemed to kill gam_server, resulting in it respawning in
> rapid and surprising ways... This patch doesn't do that, but it doesn't seem
> to provide notifications, either. Only one of the gamin tests pass. ;-) If I
> can help with debug/strace logs or whatever, please let me know.

Attached is the fix. 

gamin using inotify won't pass the test suite because the inotify
backend doesn't also use the poll backend like the dnotify backend does.

I don't have time to fix this. If anyone is interested in fixing this, I
would suggest starting with the current dnotify backend. It seems that
the inotify and dnotify backends could share a lot of code if things
were refactored properly.

-- 
John McCutchan <ttb tentacle dhs org>
? Makefile
? Makefile.in
? aclocal.m4
? autom4te.cache
? config.h
? config.h.in
? config.log
? config.status
? configure
? gamin.pc
? gamin.spec
? libtool
? stamp-h1
? doc/Makefile
? doc/Makefile.in
? lib/Makefile
? lib/Makefile.in
? libgamin/Makefile
? libgamin/Makefile.in
? libgamin/gam_error.c
? libgamin/gam_event.c
? libgamin/gamin
? python/Makefile
? python/Makefile.in
? python/tests/Makefile
? python/tests/Makefile.in
? server/Makefile
? server/Makefile.in
? server/gam_server
? tests/Makefile
? tests/Makefile.in
? tests/testgam
Index: server/gam_inotify.c
===================================================================
RCS file: /cvs/gnome/gamin/server/gam_inotify.c,v
retrieving revision 1.11
diff -u -r1.11 gam_inotify.c
--- server/gam_inotify.c	28 Jan 2005 22:05:17 -0000	1.11
+++ server/gam_inotify.c	29 Jan 2005 18:49:02 -0000
@@ -231,8 +231,7 @@
 
     G_LOCK(inotify);
 
-    buffer_size = ioctl(fd, FIONREAD);
-    if (buffer_size < 0) {
+    if (ioctl(fd, FIONREAD, &buffer_size) < 0) {
 	G_UNLOCK(inotify);
 	GAM_DEBUG(DEBUG_INFO, "inotify FIONREAD < 0. kaboom!\n");
 	return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]