diff --git a/mach/proto/as/comm1.h b/mach/proto/as/comm1.h index 660f41907..391675a98 100644 --- a/mach/proto/as/comm1.h +++ b/mach/proto/as/comm1.h @@ -53,7 +53,6 @@ extern short bflag; /* -b option (no optimizations) */ #endif extern char *aoutpath INIT("a.out"); -extern char temppath[50]; extern FILE *input; extern FILE *tempfile; @@ -93,7 +92,6 @@ extern short listcolm; /* column on output */ extern short listeoln INIT(1); /* set by endline, tested by emit1 */ extern FILE *listfile; /* copy of source text */ -extern char listpath[50]; #endif #ifndef extern @@ -155,8 +153,6 @@ void emit4(long); void emitx(valu_t, int); void emitf(int size, int negative); void emitstr(int); -FILE *ffcreat(char *); -FILE *fftemp(char *, char *); void yyerror(const char *); void nosect(void); void fatal(const char *, ...); diff --git a/mach/proto/as/comm4.c b/mach/proto/as/comm4.c index 9348b802a..a47d1438d 100644 --- a/mach/proto/as/comm4.c +++ b/mach/proto/as/comm4.c @@ -32,12 +32,6 @@ static void commfinish(void); /* ========== Machine independent C routines ========== */ void stop(void) { -#if DEBUG < 2 - unlink(temppath); -#ifdef LISTING - unlink(listpath); -#endif -#endif exit(nerrors != 0); } @@ -78,13 +72,6 @@ main(int argc, char **argv) fatal("-o needs filename"); aoutpath = argv[i]; break; - case 'T': - if (*p != '\0') { - extern char *tmp_dir; - - tmp_dir = p; - } - break; case 'd': #ifdef LISTING dflag = 0; @@ -154,11 +141,11 @@ pass_1(int argc, char **argv) nbits = BITCHUNK; #endif - tempfile = fftemp(temppath, "asTXXXXXX"); + tempfile = tmpfile(); #ifdef LISTING listmode = dflag; if (listmode & 0440) - listfile = fftemp(listpath, "asLXXXXXX"); + listfile = tmpfile(); #endif for (ip = keytab; ip->i_type; ip++) item_insert(ip, H_KEY+hash(ip->i_name)); diff --git a/mach/proto/as/comm7.c b/mach/proto/as/comm7.c index debee0ca2..5611e8272 100644 --- a/mach/proto/as/comm7.c +++ b/mach/proto/as/comm7.c @@ -387,33 +387,6 @@ void emitf(int size, int negative) con_float(stringbuf, size); } -/* ---------- Error checked file I/O ---------- */ - -FILE* ffcreat(char* s) -{ - FILE* f; - - if ((f = fopen(s, "w+")) == NULL) - fatal("can't create %s", s); - return (f); -} - -#ifndef TMPDIR -#define TMPDIR "/tmp" -#endif -char* tmp_dir = TMPDIR; - -FILE* fftemp(char* path, char* tail) -{ - char* dir; - - if ((dir = getenv("TMPDIR")) == NULL) - dir = tmp_dir; - sprintf(path, "%s/%s", dir, tail); - close(mkstemp(path)); - return (ffcreat(path)); -} - /* ---------- Error handling ---------- */ /* ARGSUSED */