Use mkstemp(3).

This commit is contained in:
mycroft 2000-01-24 02:03:37 +00:00
parent 99a7ca92be
commit 4ec77e0d35

View File

@ -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");