X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fseq_save.c;h=84775b9704e83fa097b3be06b87aabce95b719f7;hp=e0f42aec68aa72646a69a70bb4bf6470133b18f2;hb=1513f7668c494c4583141d6115669b7198c14556;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b diff --git a/sbr/seq_save.c b/sbr/seq_save.c index e0f42ae..84775b9 100644 --- a/sbr/seq_save.c +++ b/sbr/seq_save.c @@ -4,6 +4,10 @@ * -- 2) save public sequences * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include @@ -27,10 +31,6 @@ seq_save (struct msgs *mp) FILE *fp; sigset_t set, oset; - /* sanity check - check that context has been read */ - if (defpath == NULL) - adios (NULL, "oops, context hasn't been read yet"); - /* check if sequence information has changed */ if (!(mp->msgflags & SEQMOD)) return; @@ -76,9 +76,9 @@ priv: * If that fails (probably because folder is * readonly), then make sequence private. */ - if ((fp = fopen (seqfile, "w")) == NULL + if ((fp = lkfopen (seqfile, "w")) == NULL && (unlink (seqfile) == -1 || - (fp = fopen (seqfile, "w")) == NULL)) { + (fp = lkfopen (seqfile, "w")) == NULL)) { admonish (attr, "unable to write"); goto priv; } @@ -96,7 +96,7 @@ priv: } if (fp) { - fclose (fp); + lkfclose (fp, seqfile); SIGPROCMASK (SIG_SETMASK, &oset, &set); /* reset signal mask */ } else { /*