- There was an off-by-one error that prevented the temporary file
from being created in the same directory as the message it was being
linked to.
- When using "dist", the assumption was that the temporary file would not
exist when m_scratch was called (it wanted to link() to the name). This
was solved by simply unlink()ing the temporary file after it was created.
/* No directory component */
return m_mktemp(pfx_in, fd_ret, fp_ret);
}
- n = (int)(cp-dir_in-1); /* Length of dir component */
+ n = (int)(cp-dir_in); /* Length of dir component */
snprintf(buffer, sizeof(buffer), "%.*s%s", n, dir_in, pfx_in);
return m_mktemp(buffer, fd_ret, fp_ret);
}
&& altmsg) {
vec[vecp++] = "-dist";
distfile = getcpy (m_mktemp2 (altmsg, invo_name, NULL, NULL));
+ unlink(distfile);
if (link (altmsg, distfile) == NOTOK) {
if (errno != EXDEV
#ifdef EISREMOTE
&& altmsg) {
vec[vecp++] = "-dist";
distfile = getcpy (m_mktemp2(altmsg, invo_name, NULL, NULL));
+ unlink(distfile);
if (link (altmsg, distfile) == NOTOK)
adios (distfile, "unable to link %s to", altmsg);
} else {