freebsd-ports/graphics/xpdf/files/patch-ab
2000-09-04 15:33:43 +00:00

28 lines
666 B
Plaintext

--- goo/gfile.cc.org Fri Sep 1 14:35:26 2000
+++ goo/gfile.cc Fri Sep 1 14:17:34 2000
@@ -468,6 +468,16 @@
int fd;
if (ext) {
+# if HAVE_MKSTEMPS
+ if ((s = getenv("TMPDIR"))) {
+ *name = new GString(s);
+ } else {
+ *name = new GString("/tmp");
+ }
+ (*name)->append("/XXXXXX");
+ (*name)->append(ext);
+ fd = mkstemps((*name)->getCString(), strlen(ext));
+# else
if (!(s = tmpnam(NULL))) {
return gFalse;
}
@@ -478,6 +488,7 @@
}
(*name)->append(ext);
fd = open((*name)->getCString(), O_WRONLY | O_CREAT | O_EXCL, 0600);
+# endif
} else {
#if HAVE_MKSTEMP
if ((s = getenv("TMPDIR"))) {