blob: d8ff43e83f93ebeecdf0714fef563cf85a1c44c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
$NetBSD: patch-cq,v 1.2 2009/12/10 20:35:57 abs Exp $
--- lib/libxview/ttysw/termsw.c.orig 1993-06-29 05:17:15.000000000 +0000
+++ lib/libxview/ttysw/termsw.c
@@ -252,8 +252,12 @@ termsw_folio_init_internal(parent, terms
/* Generate a new temporary file name and open the file up. */
(void) strcpy(tmpfile_name, "/tmp/tty.txt.XXXXXX");
+#if (defined(BSD) && (BSD >= 199103))
+ if ((fd = mkstemp(tmpfile_name)) < 0) {
+#else
(void) mktemp(tmpfile_name);
if ((fd = open(tmpfile_name, O_CREAT | O_RDWR | O_EXCL, 0600)) < 0) {
+#endif
return (XV_ERROR);
}
(void) close(fd);
|