rcvtty.c. It never would have worked, anyway, because it had 5
instead of 6 X's in the template.
{
pid_t child_id;
int bytes, seconds;
- /* volatile to prevent "might be clobbered" warning from gcc: */
- volatile int fd;
- char tmpfil[BUFSIZ];
+ int fd;
+ char *tfile;
struct stat st;
- fd = mkstemp (strncpy (tmpfil, "/tmp/rcvttyXXXXX", sizeof(tmpfil)));
- unlink (tmpfil);
+ if ((tfile = m_mktemp2(NULL, invo_name, &fd, NULL)) == NULL) {
+ advise(NULL, "unable to create temporary file in %s", get_temp_dir());
+ return NOTOK;
+ }
if ((child_id = fork()) == NOTOK) {
/* fork error */
advise(NULL, "unable to create temporary file in %s", get_temp_dir());
return NOTOK;
}
- unlink (tfile);
rewind (stdin);