diff options
| author | Eivind Eklund <eivind@FreeBSD.org> | 1997-10-08 13:46:39 +0000 |
|---|---|---|
| committer | Eivind Eklund <eivind@FreeBSD.org> | 1997-10-08 13:46:39 +0000 |
| commit | af6ab81d4368e99174fb65c5461dcb052d11fb26 (patch) | |
| tree | 981b73d4149646be1233bc94c0d44779da796491 /bin/ed/buf.c | |
| parent | bd6b64117be7d0f53ad8a12256f42ac17a223a8a (diff) | |
Notes
Diffstat (limited to 'bin/ed/buf.c')
| -rw-r--r-- | bin/ed/buf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c index 34574c569eb1..5749b0d668d1 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); |
