diff --git a/lib/attach.c b/lib/attach.c index f815b423..f9b37c26 100644 --- a/lib/attach.c +++ b/lib/attach.c @@ -57,7 +57,7 @@ int attach(faddr noden, char *ofile, int mode, char flavor, int fdn) /* * Check if we attach a file with the same name */ - if ((fdn) && (un_attach(noden, flavor, ofile) == FALSE)) { + if ((fdn) && (un_attach(noden, ofile) == FALSE)) { WriteError("attach: can't un_attach %s, %s", ofile, strerror(rc)); return FALSE; } @@ -137,7 +137,7 @@ int attach(faddr noden, char *ofile, int mode, char flavor, int fdn) /* * Remove a file from the flofile, also search for a .tic file. */ -int un_attach(faddr node, char flavor, char *filename) +int un_attach(faddr node, char *filename) { char *flofile, *buf; FILE *fp; @@ -146,17 +146,37 @@ int un_attach(faddr node, char flavor, char *filename) buf = calloc(PATH_MAX+3, sizeof(char)); flofile = calloc(PATH_MAX, sizeof(char)); - sprintf(flofile, "%s", floname(&noden, flavor)); + sprintf(flofile, "%s", floname(&node, 'h')); + if ((fp = fopen(flofile, "r+"))) { + while (fgets(buf, sizeof(buf -1), fp)) { + Striplf(buf); + Syslog('p', "hlo: \"%s\"", buf); + + } + fclose(fp); + } + + sprintf(flofile, "%s", floname(&node, 'c')); + if ((fp = fopen(flofile, "r+"))) { + while (fgets(buf, sizeof(buf -1), fp)) { + Striplf(buf); + Syslog('p', "clo: \"%s\"", buf); + + } + fclose(fp); + } + + sprintf(flofile, "%s", floname(&node, 'f')); if ((fp = fopen(flofile, "r+"))) { while (fgets(buf, sizeof(buf -1), fp)) { Striplf(buf); Syslog('p', "flo: \"%s\"", buf); } - fclose(flofile); + fclose(fp); } - + free(flofile); free(buf); diff --git a/lib/mbselib.h b/lib/mbselib.h index d058b4a1..46fa2200 100644 --- a/lib/mbselib.h +++ b/lib/mbselib.h @@ -2115,7 +2115,7 @@ int le_int(int); * From attach.c */ int attach(faddr, char *, int, char, int); -int un_attach(faddr, char, char *); +int un_attach(faddr, char *);