mktemp -> mkstemp
Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt <deraadt@openbsd.org>)
This commit is contained in:
parent
bd6b64117b
commit
af6ab81d43
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30232
@ -31,7 +31,7 @@
|
||||
static char * const rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
|
||||
#else
|
||||
static char * const rcsid =
|
||||
"$Id: buf.c,v 1.11 1997/03/24 05:45:29 imp Exp $";
|
||||
"$Id: buf.c,v 1.12 1997/08/07 21:33:39 steve Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -208,7 +208,8 @@ open_sbuf()
|
||||
isbinary = newline_added = 0;
|
||||
u = umask(077);
|
||||
strcpy(sfn, "/tmp/ed.XXXXXX");
|
||||
if ((fd = mkstemp(sfn)) == -1 ||
|
||||
if (mktemp(sfn) == NULL ||
|
||||
(fd = open(sfn, O_RDWR|O_CREAT|O_EXCL, 0666)) == -1 ||
|
||||
(sfp = fdopen(fd, "w+")) == NULL) {
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
|
Loading…
Reference in New Issue
Block a user