The first parameter of m_mktemp2(), if not NULL, is a path and the
basename is used as the directory to hold the new temporary file, but
the error message on failing to create that used get_temp_dir() and
that's often somewhere else, e.g. `mhbuild /dev/null' attempts /dev/...
Don't attempt to state the failed path in the error message as at least
that's not misleading. Perhaps the function needs some other indication
of success so it can pass back the attempted filename that failed.
mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
mode = fstat (fd, &st) != NOTOK ? (int) (st.st_mode & 0777) : m_gmprot ();
if ((cp = m_mktemp2(file, "annotate", NULL, &tmp)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
strncpy (tmpfil, cp, sizeof(tmpfil));
chmod (tmpfil, mode);
}
strncpy (tmpfil, cp, sizeof(tmpfil));
chmod (tmpfil, mode);
/* output MIME message to this temporary file */
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
/* output MIME message to this temporary file */
if ((cp = m_mktemp2(compfile, invo_name, NULL, &fp_out)) == NULL) {
- adios(NULL, "unable to create temporary file in %s", get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
strncpy(outfile, cp, sizeof(outfile));
}
strncpy(outfile, cp, sizeof(outfile));
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
if (pushsw && unique) {
char *cp = m_mktemp2(drft, invo_name, NULL, NULL);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
}
if (rename (drft, strncpy(file, cp, sizeof(file))) == NOTOK)
adios (file, "unable to rename %s to", drft);
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
char *cp = m_mktemp2(drft, invo_name, NULL, &out);
if (cp == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
}
strncpy(tmpdrf, cp, sizeof(tmpdrf));
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
&& altmsg) {
vec[vecp++] = "-dist";
if ((cp = m_mktemp2(altmsg, invo_name, NULL, NULL)) == NULL) {
- adios(NULL, "unable to create temporary file in %s",
- get_temp_dir());
+ adios(NULL, "unable to create temporary file");
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);
}
distfile = mh_xstrdup(cp);
(void) m_unlink(distfile);