diff options
author | 1996-09-23 10:54:21 +0000 | |
---|---|---|
committer | 1996-09-23 10:54:21 +0000 | |
commit | 07e278b0748736b4bafe6d10c958f29d35b9d9eb (patch) | |
tree | e5fa5c8cf82f0abb516abce465708107e73f9c02 /usr.bin/patch/patch.c | |
parent | for errors, tell which line # (diff) | |
download | wireguard-openbsd-07e278b0748736b4bafe6d10c958f29d35b9d9eb.tar.xz wireguard-openbsd-07e278b0748736b4bafe6d10c958f29d35b9d9eb.zip |
undo last; mkstemp is *hard* to do in here
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r-- | usr.bin/patch/patch.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index afb9b7307a6..9ad408495da 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: patch.c,v 1.5 1996/09/15 19:19:54 millert Exp $ */ +/* $OpenBSD: patch.c,v 1.6 1996/09/23 10:54:21 deraadt Exp $ */ /* patch - a program to apply diffs to original files * @@ -9,7 +9,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: patch.c,v 1.5 1996/09/15 19:19:54 millert Exp $"; +static char rcsid[] = "$OpenBSD: patch.c,v 1.6 1996/09/23 10:54:21 deraadt Exp $"; #endif /* not lint */ #include "INTERN.h" @@ -784,10 +784,8 @@ void init_output(name) char *name; { - int ofd; - - if ((ofd = open(name, O_CREAT|O_EXCL|O_WRONLY, 0600)) < 0 || - (ofp = fdopen(ofd, "w")) == Nullfp) + ofp = fopen(name, "w"); + if (ofp == Nullfp) pfatal2("can't create %s", name); } @@ -797,10 +795,8 @@ void init_reject(name) char *name; { - int rejfd; - - if ((rejfd = open(name, O_CREAT|O_EXCL|O_WRONLY, 0600)) < 0 || - (rejfp = fdopen(rejfd, "w")) == Nullfp) + rejfp = fopen(name, "w"); + if (rejfp == Nullfp) pfatal2("can't create %s", name); } |