[dovecot-cvs] dovecot/src/lib-storage/index index-mailbox-check.c, 1.10, 1.11

cras at dovecot.org cras at dovecot.org
Tue Oct 19 04:47:58 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv18074/lib-storage/index

Modified Files:
	index-mailbox-check.c 
Log Message:
If we can't add file to I/O notify list, close the fd so we don't leak.
Fixes IDLE leaking fds with all but Linux.



Index: index-mailbox-check.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mailbox-check.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- index-mailbox-check.c	23 Aug 2004 07:56:29 -0000	1.10
+++ index-mailbox-check.c	19 Oct 2004 01:47:55 -0000	1.11
@@ -74,7 +74,7 @@
 {
 	struct index_notify_file *file;
 	struct stat st;
-	struct io *io;
+	struct io *io = NULL;
 	struct index_notify_io *aio;
 	int fd;
 
@@ -98,6 +98,11 @@
 	else
 		file->last_stamp = fstat(fd, &st) < 0 ? 0 : st.st_mtime;
 
+	if (io == NULL) {
+		/* we couldn't add it to notify list */
+		(void)close(fd);
+	}
+
 	file->next = ibox->notify_files;
         ibox->notify_files = file;
 



More information about the dovecot-cvs mailing list