Use mkstemp(3).
This commit is contained in:
parent
99a7ca92be
commit
4ec77e0d35
@ -219,10 +219,8 @@ int main(int argc, char **argv)
|
|||||||
else {
|
else {
|
||||||
temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
|
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();
|
catch_fatal_signals();
|
||||||
int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH);
|
int fd = mkstemp(temp_index_file);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
fatal("can't create temporary index file: %1", strerror(errno));
|
fatal("can't create temporary index file: %1", strerror(errno));
|
||||||
indxfp = fdopen(fd, "w");
|
indxfp = fdopen(fd, "w");
|
||||||
|
Loading…
Reference in New Issue
Block a user