summaryrefslogtreecommitdiff
path: root/bin/ed
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ed')
-rw-r--r--bin/ed/buf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c
index e5cbe441ac0..67f57e77d7f 100644
--- a/bin/ed/buf.c
+++ b/bin/ed/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.3 1996/06/24 21:13:50 deraadt Exp $ */
+/* $OpenBSD: buf.c,v 1.4 1996/06/25 00:26:02 deraadt Exp $ */
/* $NetBSD: buf.c,v 1.15 1995/04/23 10:07:28 cgd Exp $ */
/* buf.c: This file contains the scratch-file buffer rountines for the
@@ -33,7 +33,7 @@
#if 0
static char *rcsid = "@(#)buf.c,v 1.4 1994/02/01 00:34:35 alm Exp";
#else
-static char rcsid[] = "$OpenBSD: buf.c,v 1.3 1996/06/24 21:13:50 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: buf.c,v 1.4 1996/06/25 00:26:02 deraadt Exp $";
#endif
#endif /* not lint */
@@ -210,8 +210,7 @@ open_sbuf()
isbinary = newline_added = 0;
u = umask(077);
strcpy(sfn, "/tmp/ed.XXXXXX");
- if (mktemp(sfn) == NULL ||
- (fd = open(sfn, O_RDWR|O_CREAT|O_EXCL, 0666)) == -1 ||
+ if ((fd = mkstemp(sfn)) == -1 ||
(sfp = fdopen(fd, "w+")) == NULL) {
if (fd != -1)
close(fd);