summaryrefslogtreecommitdiffstats
path: root/imap/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap/fetch.c')
-rw-r--r--imap/fetch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imap/fetch.c b/imap/fetch.c
index 257b295..10188c5 100644
--- a/imap/fetch.c
+++ b/imap/fetch.c
@@ -1592,7 +1592,7 @@ FILE *open_cached_fp(unsigned long msgnum)
{
if (fd >= 0) close(fd);
- if ((cached_fp=tmpfile()) != 0)
+ if (fd <0 && errno == ENOENT && (cached_fp=tmpfile()) != 0)
{
fprintf(cached_fp, unavailable);
if (fseek(cached_fp, 0L, SEEK_SET) < 0 ||