fclose -> m_fclose
[apps/madmutt.git] / nntp / newsrc.c
index fef72fc..bb477f5 100644 (file)
@@ -129,7 +129,7 @@ static int slurp_newsrc (NNTP_SERVER * news)
     return -1;
   /* hmm, should we use dotlock? */
   if (mx_lock_file (news->newsrc, fileno (fp), 0, 0, 1)) {
     return -1;
   /* hmm, should we use dotlock? */
   if (mx_lock_file (news->newsrc, fileno (fp), 0, 0, 1)) {
-    fclose (fp);
+    m_fclose(&fp);
     return -1;
   }
 
     return -1;
   }
 
@@ -139,7 +139,7 @@ static int slurp_newsrc (NNTP_SERVER * news)
   p_delete(&buf);
 
   mx_unlock_file (news->newsrc, fileno (fp), 0);
   p_delete(&buf);
 
   mx_unlock_file (news->newsrc, fileno (fp), 0);
-  fclose (fp);
+  m_fclose(&fp);
   return 0;
 }
 
   return 0;
 }
 
@@ -235,7 +235,7 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news)
         mutt_newsgroup_stat (data);
     }
   }
         mutt_newsgroup_stat (data);
     }
   }
-  fclose (idx);
+  m_fclose(&idx);
   return 0;
 }
 
   return 0;
 }
 
@@ -619,13 +619,13 @@ static int mutt_update_list_file (char *filename, char *section,
 
   /* if file not exist, create it */
   if ((ifp = safe_fopen (filename, "a")))
 
   /* if file not exist, create it */
   if ((ifp = safe_fopen (filename, "a")))
-    fclose (ifp);
+    m_fclose(&ifp);
   if (!(ifp = safe_fopen (filename, "r"))) {
     mutt_error (_("Unable to open %s for reading"), filename);
     return -1;
   }
   if (mx_lock_file (filename, fileno (ifp), 0, 0, 1)) {
   if (!(ifp = safe_fopen (filename, "r"))) {
     mutt_error (_("Unable to open %s for reading"), filename);
     return -1;
   }
   if (mx_lock_file (filename, fileno (ifp), 0, 0, 1)) {
-    fclose (ifp);
+    m_fclose(&ifp);
     mutt_error (_("Unable to lock %s"), filename);
     return -1;
   }
     mutt_error (_("Unable to lock %s"), filename);
     return -1;
   }
@@ -638,7 +638,7 @@ static int mutt_update_list_file (char *filename, char *section,
   m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
   mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));
   if (!(ofp = fopen (tmpfile, "w"))) {
   m_strcpy(tmpfile, sizeof(tmpfile), basename(filename));
   mutt_adv_mktemp ((const char*) dirname (buf), tmpfile, sizeof (tmpfile));
   if (!(ofp = fopen (tmpfile, "w"))) {
-    fclose (ifp);
+    m_fclose(&ifp);
     mutt_error (_("Unable to open %s for writing"), tmpfile);
     return -1;
   }
     mutt_error (_("Unable to open %s for writing"), tmpfile);
     return -1;
   }
@@ -700,8 +700,8 @@ static int mutt_update_list_file (char *filename, char *section,
     r = fputc ('\n', ofp);
   }
   mx_unlock_file (filename, fileno (ifp), 0);
     r = fputc ('\n', ofp);
   }
   mx_unlock_file (filename, fileno (ifp), 0);
-  fclose (ofp);
-  fclose (ifp);
+  m_fclose(&ofp);
+  m_fclose(&ifp);
   if (r == EOF) {
     unlink (tmpfile);
     mutt_error (_("Can't write %s"), tmpfile);
   if (r == EOF) {
     unlink (tmpfile);
     mutt_error (_("Can't write %s"), tmpfile);
@@ -848,13 +848,13 @@ int nntp_save_cache_index (NNTP_SERVER * news)
         snprintf (buf, sizeof (buf), "%s %d %d %c\n", d->group,
                   d->lastMessage, d->firstMessage, d->allowed ? 'y' : 'n');
       if (fputs (buf, f) == EOF) {
         snprintf (buf, sizeof (buf), "%s %d %d %c\n", d->group,
                   d->lastMessage, d->firstMessage, d->allowed ? 'y' : 'n');
       if (fputs (buf, f) == EOF) {
-        fclose (f);
+        m_fclose(&f);
         unlink (file);
         return -1;
       }
     }
   }
         unlink (file);
         return -1;
       }
     }
   }
-  fclose (f);
+  m_fclose(&f);
 
   if (nntp_update_cacheindex (news, NULL)) {
     unlink (file);
 
   if (nntp_update_cacheindex (news, NULL)) {
     unlink (file);
@@ -921,7 +921,7 @@ int nntp_save_cache_group (CONTEXT * ctx)
       snprintf (buf, sizeof (buf), "\t%zd\t%d\tXref: %s\n",
                 h->content->length, h->lines, NONULL (h->env->xref));
       if (fputs (buf, f) == EOF) {
       snprintf (buf, sizeof (buf), "\t%zd\t%d\tXref: %s\n",
                 h->content->length, h->lines, NONULL (h->env->xref));
       if (fputs (buf, f) == EOF) {
-        fclose (f);
+        m_fclose(&f);
         unlink (file);
         return -1;
       }
         unlink (file);
         return -1;
       }
@@ -933,7 +933,7 @@ int nntp_save_cache_group (CONTEXT * ctx)
     Sort = save;
     mutt_sort_headers (ctx, 0);
   }
     Sort = save;
     mutt_sort_headers (ctx, 0);
   }
-  fclose (f);
+  m_fclose(&f);
 
   if (nntp_update_cacheindex (((NNTP_DATA *) ctx->data)->nserv,
                               (NNTP_DATA *) ctx->data)) {
 
   if (nntp_update_cacheindex (((NNTP_DATA *) ctx->data)->nserv,
                               (NNTP_DATA *) ctx->data)) {