summaryrefslogtreecommitdiffstats
path: root/usr.bin/patch/patch.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-07-01 20:40:07 +0000
committerderaadt <deraadt@openbsd.org>1996-07-01 20:40:07 +0000
commit4c36d7f787f72ccb23c6cb7317bc3f95a7c45fa3 (patch)
treea54c814335cfcaddb3eb5625141a1e90833cd1fd /usr.bin/patch/patch.c
parentbuild kernel automatically (diff)
downloadwireguard-openbsd-4c36d7f787f72ccb23c6cb7317bc3f95a7c45fa3.tar.xz
wireguard-openbsd-4c36d7f787f72ccb23c6cb7317bc3f95a7c45fa3.zip
undo mktemp cleanup until i get it right
Diffstat (limited to 'usr.bin/patch/patch.c')
-rw-r--r--usr.bin/patch/patch.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index dcfb1213cca..dfbe51cba76 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.3 1996/06/25 23:06:39 deraadt Exp $ */
+/* $OpenBSD: patch.c,v 1.4 1996/07/01 20:40:09 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.3 1996/06/25 23:06:39 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: patch.c,v 1.4 1996/07/01 20:40:09 deraadt Exp $";
#endif /* not lint */
#include "INTERN.h"
@@ -784,14 +784,9 @@ void
init_output(name)
char *name;
{
- int fd;
-
- if ((fd = open(name, O_EXCL|O_CREAT|O_RDWR, 0666)) == -1 ||
- (ofp = fdopen(fd, "w")) == NULL) {
- if (fd != -1)
- close(fd);
+ ofp = fopen(name, "w");
+ if (ofp == Nullfp)
pfatal2("can't create %s", name);
- }
}
/* Open a file to put hunks we can't locate. */
@@ -800,14 +795,9 @@ void
init_reject(name)
char *name;
{
- int fd;
-
- if ((fd = open(name, O_EXCL|O_CREAT|O_RDWR, 0666)) == -1 ||
- (rejfp = fdopen(fd, "w")) == NULL) {
- if (fd != -1)
- close(fd);
+ rejfp = fopen(name, "w");
+ if (rejfp == Nullfp)
pfatal2("can't create %s", name);
- }
}
/* Copy input file to output, up to wherever hunk is to be applied. */