blob: b3cfe227d5d152fb26fcf293b896a66614f77e74 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
--- indxbib/indxbib.cc.~2~ Wed Mar 8 00:23:35 2000
+++ indxbib/indxbib.cc Wed Mar 8 00:31:02 2000
@@ -222,10 +222,16 @@
else {
temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
}
+#ifndef HAVE_MKSTEMP
if (!mktemp(temp_index_file) || !temp_index_file[0])
fatal("cannot create file name for temporary file");
+#endif
catch_fatal_signals();
+#ifdef HAVE_MKSTEMP
+ int fd = mkstemp(temp_index_file);
+#else
int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH);
+#endif
if (fd < 0)
fatal("can't create temporary index file: %1", strerror(errno));
indxfp = fdopen(fd, "w");
|