summaryrefslogtreecommitdiff
path: root/usr.bin/m4/main.c
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-09-06 13:20:41 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-09-06 13:20:41 +0000
commit15ad24c8377afe4177bc2409a503c8251e6b390a (patch)
tree65df66ab40239d7f5747ac225b49edd82748b8f7 /usr.bin/m4/main.c
parent8377b604ba1a34886d86ff7a2496219dfc1cc14f (diff)
Get rid of mktemp in the handling of diversion.
Simply put, mkstemp/unlink/rewind has the proper semantics under Unix, and so we don't have to keep track about temp file names and remove them.
Diffstat (limited to 'usr.bin/m4/main.c')
-rw-r--r--usr.bin/m4/main.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index 050d3585701..9b311261e64 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.11 1999/09/06 13:10:48 espie Exp $ */
+/* $OpenBSD: main.c,v 1.12 1999/09/06 13:20:40 espie Exp $ */
/* $NetBSD: main.c,v 1.12 1997/02/08 23:54:49 cgd Exp $ */
/*-
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.11 1999/09/06 13:10:48 espie Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.12 1999/09/06 13:20:40 espie Exp $";
#endif
#endif /* not lint */
@@ -85,7 +85,6 @@ int fp; /* m4 call frame pointer */
FILE *infile[MAXINP]; /* input file stack (0=stdin) */
FILE *outfile[MAXOUT]; /* diversion array(0=bitbucket)*/
FILE *active; /* active output file pointer */
-char *m4temp; /* filename for diversions */
int ilevel = 0; /* input file stack pointer */
int oindex = 0; /* diversion index.. */
char *null = ""; /* as it says.. just a null.. */
@@ -188,9 +187,6 @@ main(argc,argv)
argv += optind;
active = stdout; /* default active output */
- /* filename for diversions */
- m4temp = mktemp(xstrdup(_PATH_DIVNAME));
-
bbase[0] = bufbase;
if (!argc) {
sp = -1; /* stack pointer initialized */
@@ -228,12 +224,6 @@ main(argc,argv)
/* remove bitbucket if used */
if (outfile[0] != NULL) {
(void) fclose(outfile[0]);
- m4temp[UNIQUE] = '0';
-#ifdef vms
- (void) remove(m4temp);
-#else
- (void) unlink(m4temp);
-#endif
}
return 0;