X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=nntp%2Fnewsrc.c;h=bb477f53067adf3805bff1e4d5ca558f8f009deb;hp=fef72fc0b2f66f84394af7c12bc2451d9206911b;hb=9ed7a487e3a922f2cbb222961c2c9710c3a65f91;hpb=b62cf5fb77a75e17b176141d232655e5bd8b7fe1 diff --git a/nntp/newsrc.c b/nntp/newsrc.c index fef72fc..bb477f5 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -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)) { - fclose (fp); + m_fclose(&fp); return -1; } @@ -139,7 +139,7 @@ static int slurp_newsrc (NNTP_SERVER * news) p_delete(&buf); mx_unlock_file (news->newsrc, fileno (fp), 0); - fclose (fp); + m_fclose(&fp); return 0; } @@ -235,7 +235,7 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news) mutt_newsgroup_stat (data); } } - fclose (idx); + m_fclose(&idx); 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"))) - 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)) { - fclose (ifp); + m_fclose(&ifp); 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"))) { - fclose (ifp); + m_fclose(&ifp); 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); - fclose (ofp); - fclose (ifp); + m_fclose(&ofp); + m_fclose(&ifp); 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) { - fclose (f); + m_fclose(&f); unlink (file); return -1; } } } - fclose (f); + m_fclose(&f); 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) { - fclose (f); + m_fclose(&f); unlink (file); return -1; } @@ -933,7 +933,7 @@ int nntp_save_cache_group (CONTEXT * ctx) 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)) {