diff options
author | eivind <eivind@FreeBSD.org> | 1997-10-09 11:05:16 +0000 |
---|---|---|
committer | eivind <eivind@FreeBSD.org> | 1997-10-09 11:05:16 +0000 |
commit | d6e21d08f0652974f8297cf60389d78c744f9842 (patch) | |
tree | fb47b3e75726a32d83afe535cf1ed250c2df018c /bin/ed | |
parent | 34721f2246b448528bd18c19d0016b1bdfe149f2 (diff) | |
download | FreeBSD-src-d6e21d08f0652974f8297cf60389d78c744f9842.zip FreeBSD-src-d6e21d08f0652974f8297cf60389d78c744f9842.tar.gz |
Un-clobber mktemp->mkstemp patch.
Diffstat (limited to 'bin/ed')
-rw-r--r-- | bin/ed/buf.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/bin/ed/buf.c b/bin/ed/buf.c index 5749b0d..7694d5f 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.12 1997/08/07 21:33:39 steve Exp $"; + "$Id: buf.c,v 1.13 1997/10/08 13:46:39 eivind Exp $"; #endif #endif /* not lint */ @@ -208,8 +208,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); |