Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/usr.bin/crunch/crunchgen pullup 1.10->1.11 (cgd)



details:   https://anonhg.NetBSD.org/src/rev/0f98543a0ac3
branches:  netbsd-1-4
changeset: 468763:0f98543a0ac3
user:      perry <perry%NetBSD.org@localhost>
date:      Mon Jun 21 13:47:46 1999 +0000

description:
pullup 1.10->1.11 (cgd)

diffstat:

 usr.bin/crunch/crunchgen/crunchgen.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (66 lines):

diff -r bc55e80eb80f -r 0f98543a0ac3 usr.bin/crunch/crunchgen/crunchgen.c
--- a/usr.bin/crunch/crunchgen/crunchgen.c      Mon Jun 21 13:38:00 1999 +0000
+++ b/usr.bin/crunch/crunchgen/crunchgen.c      Mon Jun 21 13:47:46 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crunchgen.c,v 1.9 1998/09/13 05:32:18 wrstuden Exp $   */
+/*     $NetBSD: crunchgen.c,v 1.9.2.1 1999/06/21 13:47:46 perry Exp $  */
 /*
  * Copyright (c) 1994 University of Maryland
  * All Rights Reserved.
@@ -33,7 +33,7 @@
  */
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: crunchgen.c,v 1.9 1998/09/13 05:32:18 wrstuden Exp $");
+__RCSID("$NetBSD: crunchgen.c,v 1.9.2.1 1999/06/21 13:47:46 perry Exp $");
 #endif
 
 #include <stdlib.h>
@@ -167,7 +167,7 @@
        (void)snprintf(execfname, sizeof(execfname), "%s", confname);
 
     (void)snprintf(cachename, sizeof(cachename), "%s.cache", confname);
-    (void)snprintf(tempfname, sizeof(tempfname), ".tmp_%sXXXXXX", confname);
+    (void)snprintf(tempfname, sizeof(tempfname), "/tmp/%sXXXXXX", confname);
 
     parse_conf_file();
     gen_outputs();
@@ -523,7 +523,7 @@
     if(p->srcdir)
        (void)snprintf(path, sizeof(path), "%s/Makefile", p->srcdir);
     if(!p->objs && p->srcdir && is_nonempty_file(path))
-       fillin_program_objs(p, path);
+       fillin_program_objs(p, p->srcdir);
 
     if(!p->objpaths && p->objdir && p->objs)
        for(s = p->objs; s != NULL; s = s->next) {
@@ -546,7 +546,7 @@
     }
 }
 
-void fillin_program_objs(prog_t *p, char *path)
+void fillin_program_objs(prog_t *p, char *dirpath)
 {
     char *obj, *cp;
     int rc;
@@ -566,16 +566,16 @@
        return;
     }
        
-    fprintf(f, ".include \"%s\"\n", path);
+    fprintf(f, ".include \"Makefile\"\n");
     fprintf(f, ".if defined(PROG) && !defined(OBJS)\n");
     fprintf(f, "OBJS=${PROG}.o\n");
     fprintf(f, ".endif\n");
     fprintf(f, "crunchgen_objs:\n\t@echo 'OBJS= '${OBJS}\n");
     fclose(f);
 
-    (void)snprintf(line, sizeof(line), "make -f %s crunchgen_objs 2>&1",
-       tempfname);
-    if((f = popen(line, "r")) == NULL) {
+    (void)snprintf(line, sizeof(line),
+       "cd %s && make -f %s crunchgen_objs 2>&1", dirpath, tempfname);
+    if((f = popen(line, "r+")) == NULL) {
        perror("submake pipe");
        goterror = 1;
        return;



Home | Main Index | Thread Index | Old Index