X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/a23477eb9bd7d1af5f66a171041bf72af932488e..cfb444d37fc236a9fdac369cbcf2a5bfc37a33f5:/uip/distsbr.c diff --git a/uip/distsbr.c b/uip/distsbr.c index 640b30a5..c9f6656b 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -8,6 +8,7 @@ #include #include #include +#include "../sbr/m_mktemp.h" static int hdrfd = NOTOK; static int txtfd = NOTOK; @@ -41,7 +42,7 @@ distout (char *drft, char *msgnam, char *backup) chmod (drft, m_gmprot ()); ready_msg (msgnam); - lseek (hdrfd, (off_t) 0, SEEK_SET); /* msgnam not accurate */ + lseek(hdrfd, 0, SEEK_SET); /* msgnam not accurate */ cpydata (hdrfd, fileno (ofp), msgnam, drft); for (resent = NULL;;) { @@ -110,7 +111,7 @@ process: ; free (resent); if (txtfd != NOTOK) { - lseek (txtfd, (off_t) 0, SEEK_SET); /* msgnam not accurate */ + lseek(txtfd, 0, SEEK_SET); /* msgnam not accurate */ cpydata (txtfd, fileno (ofp), msgnam, drft); } @@ -129,10 +130,14 @@ ready_msg (char *msgnam) char *cp = NULL; m_getfld_state_t gstate = 0; - if (hdrfd != NOTOK) - close (hdrfd), hdrfd = NOTOK; - if (txtfd != NOTOK) - close (txtfd), txtfd = NOTOK; + if (hdrfd != NOTOK) { + close (hdrfd); + hdrfd = NOTOK; + } + if (txtfd != NOTOK) { + close (txtfd); + txtfd = NOTOK; + } if ((ifp = fopen (msgnam, "r")) == NULL) adios (msgnam, "unable to open message");