- patch to use mkstemp instead of tmpnam

Submitted by:	mi@aldan.algebra.com (Mikhail Teterin)
This commit is contained in:
Dirk Meyer 2001-05-07 18:37:02 +00:00
parent 72bd7e8e3e
commit cb3ed2d00e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=42378
4 changed files with 36 additions and 0 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= tcl
PORTVERSION= 8.3.3
PORTREVISION= 1
CATEGORIES= lang tcl83
MASTER_SITES= ${MASTER_SITE_TCLTK}
MASTER_SITE_SUBDIR= tcl8_3

View File

@ -0,0 +1,17 @@
--- tclUnixPipe.c Tue Apr 3 18:54:39 2001
+++ tclUnixPipe.c Sat Apr 28 12:41:46 2001
@@ -193,13 +193,10 @@
/*
* Linux says we should use mkstemp, but Solaris prefers tmpnam.
* We should also check against making more then TMP_MAX of these.
*/
- if (tmpnam(fileName) == NULL) { /* INTL: Native. */
- return NULL;
- }
- fd = open(fileName, O_RDWR|O_CREAT|O_EXCL, 0666); /* INTL: Native. */
+ fd = mkstemp(fileName); /* INTL: Native. */
if (fd == -1) {
return NULL;
}
fcntl(fd, F_SETFD, FD_CLOEXEC);

View File

@ -7,6 +7,7 @@
PORTNAME= tcl
PORTVERSION= 8.3.3
PORTREVISION= 1
CATEGORIES= lang tcl83
MASTER_SITES= ${MASTER_SITE_TCLTK}
MASTER_SITE_SUBDIR= tcl8_3

View File

@ -0,0 +1,17 @@
--- tclUnixPipe.c Tue Apr 3 18:54:39 2001
+++ tclUnixPipe.c Sat Apr 28 12:41:46 2001
@@ -193,13 +193,10 @@
/*
* Linux says we should use mkstemp, but Solaris prefers tmpnam.
* We should also check against making more then TMP_MAX of these.
*/
- if (tmpnam(fileName) == NULL) { /* INTL: Native. */
- return NULL;
- }
- fd = open(fileName, O_RDWR|O_CREAT|O_EXCL, 0666); /* INTL: Native. */
+ fd = mkstemp(fileName); /* INTL: Native. */
if (fd == -1) {
return NULL;
}
fcntl(fd, F_SETFD, FD_CLOEXEC);