Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/crunch/crunchgen Move tempfname[] to fillin_program_...
details: https://anonhg.NetBSD.org/src/rev/af64926972e3
branches: trunk
changeset: 524822:af64926972e3
user: lukem <lukem%NetBSD.org@localhost>
date: Sun Mar 31 08:02:08 2002 +0000
description:
Move tempfname[] to fillin_program_objs() (the only place that calls it),
and assign it before each use of mkstemp(3).
Problem noted by Ben Harris <bjh21%netbsd.org@localhost> in [toolchain/16140].
diffstat:
usr.bin/crunch/crunchgen/crunchgen.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (47 lines):
diff -r 1b5d91aeffdc -r af64926972e3 usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c Sun Mar 31 07:48:15 2002 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c Sun Mar 31 08:02:08 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: crunchgen.c,v 1.34 2002/03/31 07:48:15 lukem Exp $ */
+/* $NetBSD: crunchgen.c,v 1.35 2002/03/31 08:02:08 lukem Exp $ */
/*
* Copyright (c) 1994 University of Maryland
* All Rights Reserved.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: crunchgen.c,v 1.34 2002/03/31 07:48:15 lukem Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.35 2002/03/31 08:02:08 lukem Exp $");
#endif
#if HAVE_CONFIG_H
@@ -88,7 +88,7 @@
char confname[MAXPATHLEN], infilename[MAXPATHLEN];
char outmkname[MAXPATHLEN], outcfname[MAXPATHLEN], execfname[MAXPATHLEN];
-char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN];
+char cachename[MAXPATHLEN], curfilename[MAXPATHLEN];
char topdir[MAXPATHLEN];
char libdir[MAXPATHLEN] = "/usr/lib";
char dbg[MAXPATHLEN] = "-Os";
@@ -192,7 +192,6 @@
(void)snprintf(execfname, sizeof(execfname), "%s", confname);
(void)snprintf(cachename, sizeof(cachename), "%s.cache", confname);
- (void)snprintf(tempfname, sizeof(tempfname), "/tmp/%sXXXXXX", confname);
parse_conf_file();
gen_outputs();
@@ -598,9 +597,11 @@
int rc;
int fd;
FILE *f;
+ char tempfname[MAXPATHLEN];
/* discover the objs from the srcdir Makefile */
+ (void)snprintf(tempfname, sizeof(tempfname), "/tmp/%sXXXXXX", confname);
if((fd = mkstemp(tempfname)) < 0) {
perror(tempfname);
exit(1);
Home |
Main Index |
Thread Index |
Old Index