* rename the draft file. I'm not quite sure why.
*/
if (pushsw && unique) {
- char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
- if (cp == NULL) {
- adios ("sendsbr", "unable to create temporary file");
- }
+ char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
+ if (cp == NULL) {
+ adios(NULL, "unable to create temporary file in %s",
+ get_temp_dir());
+ }
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
drft = file;
done=exit;
if (distfile)
- unlink (distfile);
+ (void) m_unlink (distfile);
return status;
}
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
- adios (drft, "unable to create temporary file for");
+ adios(NULL, "unable to create temporary file in %s",
+ get_temp_dir());
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
- chmod (tmpdrf, 0600);
/*
* Output the header fields
snprintf (partnum, sizeof(partnum), "%d", partno);
status = sendaux (vec, vecp, program, tmpdrf, st);
- unlink (tmpdrf);
+ (void) m_unlink (tmpdrf);
if (status != OK)
break;
snprintf (buf, sizeof(buf), "%d", fd2);
vec[vecp++] = buf;
} else {
- admonish (NULL, "unable to create file for annotation list");
+ admonish (NULL, "unable to create temporary file in %s "
+ "for annotation list", get_temp_dir());
}
}
if (distfile && distout (drft, distfile, backup) == NOTOK)
if (annotext && fd2 != NOTOK)
close (fd2);
if (distfile) {
- unlink (drft);
+ (void) m_unlink (drft);
if (rename (backup, drft) == NOTOK)
advise (drft, "unable to rename %s to", backup);
}
tmp_fd (void)
{
int fd;
- char *tfile = NULL;
+ char *tfile;
- tfile = m_mktemp2(NULL, invo_name, &fd, NULL);
- if (tfile == NULL) return NOTOK;
- fchmod(fd, 0600);
+ if ((tfile = m_mktemp2(NULL, invo_name, &fd, NULL)) == NULL) return NOTOK;
if (debugsw)
advise (NULL, "temporary file %s selected", tfile);
else
- if (unlink (tfile) == NOTOK)
+ if (m_unlink (tfile) == NOTOK)
advise (tfile, "unable to remove");
return fd;
sigaddset (&set, SIGTERM);
sigprocmask (SIG_BLOCK, &set, &oset);
+ unregister_for_removal(0);
+
annoaux (fd);
if (child_id == OK)
_exit (0);