[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pan-devel] PATCH to close cache files before unlinking
From: |
John Morris |
Subject: |
[Pan-devel] PATCH to close cache files before unlinking |
Date: |
Thu, 19 Sep 2002 03:12:45 -0500 |
Hi all,
I just joined the mailing list, and I have a patch for a problem I had
with Pan 0.13.0.90.
I was having problems with Pan running out of file descriptors when
downloading a large amount of binaries, and "lsof" showed that all the
cache files were being opened, but never closed, even after unlinking.
So, I made the change I'm attaching, and all is now well.
John Morris
address@hidden
Patch follows:
--- pan/base/acache.c.org 2002-09-19 02:41:07.000000000 -0500
+++ pan/base/acache.c 2002-09-19 02:43:42.000000000 -0500
@@ -71,6 +71,7 @@
typedef struct
{
AcachePath * path;
+ FILE * file_ptr;
int refcount;
char * message_id;
size_t size;
@@ -325,6 +326,7 @@
/* remove the file */
acache_get_filename (filename, sizeof(filename), entry->path->path,
entry->message_id);
+ fclose(entry->file_ptr);
unlink (filename);
}
@@ -637,6 +639,7 @@
else
{
GMimeStream * file_stream = g_mime_stream_file_new (fp);
+ entry->file_ptr=fp;
retval = g_mime_stream_buffer_new (file_stream,
GMIME_STREAM_BUFFER_BLOCK_READ);
g_object_unref (file_stream);
}
- [Pan-devel] PATCH to close cache files before unlinking,
John Morris <=