Generate temporary files with mkstemp instead of mktemp

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2015-04-11 05:20:01 +00:00
parent 1103e0c1bc
commit 93b278f08d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281404

View File

@ -209,12 +209,12 @@ setup_pipe(const char *test, int *fdp)
static void
setup_fifo(const char *test, int *fdp)
{
char path[PATH_MAX];
char path[] = "0send_fifo.XXXXXXX";
int fd1, fd2;
strcpy(path, "/tmp/0send_fifo.XXXXXXX");
if (mktemp(path) == NULL)
if (mkstemp(path) == -1)
err(-1, "%s: setup_fifo: mktemp", test);
unlink(path);
if (mkfifo(path, 0600) < 0)
err(-1, "%s: setup_fifo: mkfifo(%s)", test, path);