From af6ab81d4368e99174fb65c5461dcb052d11fb26 Mon Sep 17 00:00:00 2001 From: Eivind Eklund Date: Wed, 8 Oct 1997 13:46:39 +0000 Subject: [PATCH] mktemp -> mkstemp Obtained from: OpenBSD (file rev 1.4 by Theo de Raadt ) --- bin/ed/buf.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/ed/buf.c b/bin/ed/buf.c index 34574c569eb..5749b0d668d 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);