From 4ec77e0d35650532ea153f2baaae51a6881ba12c Mon Sep 17 00:00:00 2001 From: mycroft Date: Mon, 24 Jan 2000 02:03:37 +0000 Subject: [PATCH] Use mkstemp(3). --- gnu/usr.bin/groff/indxbib/indxbib.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gnu/usr.bin/groff/indxbib/indxbib.cc b/gnu/usr.bin/groff/indxbib/indxbib.cc index fe310c35bb3b..28c638758aa5 100644 --- a/gnu/usr.bin/groff/indxbib/indxbib.cc +++ b/gnu/usr.bin/groff/indxbib/indxbib.cc @@ -219,10 +219,8 @@ int main(int argc, char **argv) else { temp_index_file = strsave(TEMP_INDEX_TEMPLATE); } - if (!mktemp(temp_index_file) || !temp_index_file[0]) - fatal("cannot create file name for temporary file"); catch_fatal_signals(); - int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH); + int fd = mkstemp(temp_index_file); if (fd < 0) fatal("can't create temporary index file: %1", strerror(errno)); indxfp = fdopen(fd, "w");