summaryrefslogtreecommitdiffstats
path: root/bin/ed/buf.c
diff options
context:
space:
mode:
authoreivind <eivind@FreeBSD.org>1997-10-08 13:46:39 +0000
committereivind <eivind@FreeBSD.org>1997-10-08 13:46:39 +0000
commitb197c558d0c3e8c5cd7b1b4c9c8d79a8f6e654fd (patch)
tree2522bf393e95fd4d25c4ce47ce11ff911a7f8cf9 /bin/ed/buf.c
parenta63bff464b378362cad67f15e0d3f291f82375d6 (diff)
downloadFreeBSD-src-b197c558d0c3e8c5cd7b1b4c9c8d79a8f6e654fd.zip
FreeBSD-src-b197c558d0c3e8c5cd7b1b4c9c8d79a8f6e654fd.tar.gz
mktemp -> mkstemp
Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt <deraadt@openbsd.org>)
Diffstat (limited to 'bin/ed/buf.c')
-rw-r--r--bin/ed/buf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index 34574c5..5749b0d 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -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);
OpenPOWER on IntegriCloud