X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2e768e3cc0ce768373d3320eca4cdd08b8cf646a..e6917522:/uip/distsbr.c?ds=inline diff --git a/uip/distsbr.c b/uip/distsbr.c index d7a27120..2d9239e9 100644 --- a/uip/distsbr.c +++ b/uip/distsbr.c @@ -87,7 +87,7 @@ distout (char *drft, char *msgnam, char *backup) leave_bad: ; fclose (ifp); fclose (ofp); - unlink (drft); + (void) m_unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; @@ -104,7 +104,7 @@ process: ; if (!resent) { advise (NULL, BADMSG, "draft"); fclose (ofp); - unlink (drft); + (void) m_unlink (drft); if (rename (backup, drft) == NOTOK) adios (drft, "unable to rename %s to", backup); return NOTOK; @@ -141,14 +141,13 @@ ready_msg (char *msgnam) cp = m_mktemp2(NULL, "dist", &hdrfd, NULL); if (cp == NULL) { - adios("distsbr", "unable to create temporary file"); + adios(NULL, "unable to create temporary file in %s", get_temp_dir()); } - fchmod(hdrfd, 0600); strncpy(tmpfil, cp, sizeof(tmpfil)); if ((out = dup (hdrfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); - unlink (tmpfil); + (void) m_unlink (tmpfil); for (;;) { int buffersz = sizeof buffer; @@ -170,14 +169,15 @@ ready_msg (char *msgnam) cp = m_mktemp2(NULL, "dist", &txtfd, NULL); if (cp == NULL) { - adios("distsbr", "unable to create temporary file"); + adios(NULL, "unable to create temporary file in %s", + get_temp_dir()); } fchmod(txtfd, 0600); strncpy (tmpfil, cp, sizeof(tmpfil)); if ((out = dup (txtfd)) == NOTOK || (ofp = fdopen (out, "w")) == NULL) adios (NULL, "no file descriptors -- you lose big"); - unlink (tmpfil); + (void) m_unlink (tmpfil); fprintf (ofp, "\n%s", buffer); while (state == BODY) { buffersz = sizeof buffer;