use mkstemp
This commit is contained in:
parent
3e4fcb2e57
commit
525cc80c04
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: msgs.c,v 1.13 1998/12/19 20:08:03 christos Exp $ */
|
/* $NetBSD: msgs.c,v 1.14 1999/04/20 07:24:49 mrg Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1980, 1993
|
* Copyright (c) 1980, 1993
|
||||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95";
|
static char sccsid[] = "@(#)msgs.c 8.2 (Berkeley) 4/28/95";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: msgs.c,v 1.13 1998/12/19 20:08:03 christos Exp $");
|
__RCSID("$NetBSD: msgs.c,v 1.14 1999/04/20 07:24:49 mrg Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -77,8 +77,10 @@ __RCSID("$NetBSD: msgs.c,v 1.13 1998/12/19 20:08:03 christos Exp $");
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <err.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
@ -90,6 +92,7 @@ __RCSID("$NetBSD: msgs.c,v 1.13 1998/12/19 20:08:03 christos Exp $");
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "pathnames.h"
|
#include "pathnames.h"
|
||||||
|
|
||||||
#define CMODE 0664 /* bounds file creation mode */
|
#define CMODE 0664 /* bounds file creation mode */
|
||||||
@ -784,8 +787,13 @@ ask(prompt)
|
|||||||
strcpy(fname, "Messages");
|
strcpy(fname, "Messages");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
int fd;
|
||||||
|
|
||||||
strcpy(fname, _PATH_TMP);
|
strcpy(fname, _PATH_TMP);
|
||||||
mktemp(fname);
|
fd = mkstemp(fname);
|
||||||
|
if (fd == -1)
|
||||||
|
err(1, "mkstemp failed");
|
||||||
|
close(fd);
|
||||||
sprintf(cmdbuf, _PATH_MAIL, fname);
|
sprintf(cmdbuf, _PATH_MAIL, fname);
|
||||||
mailing = YES;
|
mailing = YES;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user