diff options
author | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1998-03-04 00:53:43 +0000 |
---|---|---|
committer | Angelos D. Keromytis <angelos@cvs.openbsd.org> | 1998-03-04 00:53:43 +0000 |
commit | f136b21fd73cfa6f2081681208861ef7407a7a9e (patch) | |
tree | ea09e63d3891780441d314d80863a2093521eec8 /gnu/usr.bin/groff/indxbib | |
parent | 365e87acb1b651256fec810051d4faf3a2e1630e (diff) |
Fix mktemp()->mkstemp()...
Diffstat (limited to 'gnu/usr.bin/groff/indxbib')
-rw-r--r-- | gnu/usr.bin/groff/indxbib/indxbib.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gnu/usr.bin/groff/indxbib/indxbib.cc b/gnu/usr.bin/groff/indxbib/indxbib.cc index fe310c35bb3..fb353247c80 100644 --- a/gnu/usr.bin/groff/indxbib/indxbib.cc +++ b/gnu/usr.bin/groff/indxbib/indxbib.cc @@ -219,12 +219,12 @@ int main(int argc, char **argv) else { temp_index_file = strsave(TEMP_INDEX_TEMPLATE); } - if (!mktemp(temp_index_file) || !temp_index_file[0]) + int fd = mkstemp(temp_index_file); + if (fd == -1 || !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); - if (fd < 0) - fatal("can't create temporary index file: %1", strerror(errno)); + if (fchmod(fd, S_IRUSR|S_IRGRP|S_IROTH) < 0) + fatal("cannot change permissions for temporary file"); indxfp = fdopen(fd, "w"); if (indxfp == 0) fatal("fdopen failed"); |