=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/pch.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/patch/pch.c 1996/06/25 23:06:41 1.3 +++ src/usr.bin/patch/pch.c 1996/07/01 20:40:10 1.4 @@ -1,7 +1,7 @@ -/* $OpenBSD: pch.c,v 1.3 1996/06/25 23:06:41 deraadt Exp $ */ +/* $OpenBSD: pch.c,v 1.4 1996/07/01 20:40:10 deraadt Exp $ */ #ifndef lint -static char rcsid[] = "$OpenBSD: pch.c,v 1.3 1996/06/25 23:06:41 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: pch.c,v 1.4 1996/07/01 20:40:10 deraadt Exp $"; #endif /* not lint */ #include "EXTERN.h" @@ -54,15 +54,10 @@ open_patch_file(filename) char *filename; { - int fd; - if (filename == Nullch || !*filename || strEQ(filename, "-")) { - if ((fd = open(TMPPATNAME, O_EXCL|O_CREAT|O_RDWR, 0666)) == -1 || - (pfp = fdopen(fd, "w")) == NULL) { - if (fd != -1) - close(fd); + pfp = fopen(TMPPATNAME, "w"); + if (pfp == Nullfp) pfatal2("can't create %s", TMPPATNAME); - } while (fgets(buf, sizeof buf, stdin) != Nullch) fputs(buf, pfp); Fclose(pfp);