summaryrefslogtreecommitdiff
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-23 10:54:23 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-09-23 10:54:23 +0000
commitd39691df26224dd4802b69c04a38d501cd26b595 (patch)
tree83f25ab813670c0fe864c2f973af18b464dc2ab3 /usr.bin/patch/patch.c
parent35fcd59ab7d5e77c7a61c3e76b92fa873b6047f9 (diff)
undo last; mkstemp is *hard* to do in here
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c16
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);
}