Avoid entirely silly rpmio use in addFileToTagAux()

This commit is contained in:
Panu Matilainen 2008-03-24 19:00:48 +02:00
parent 3531bc5d8c
commit 7ae38cdd44
1 changed files with 3 additions and 5 deletions

View File

@ -115,17 +115,15 @@ static StringBuf addFileToTagAux(rpmSpec spec,
char buf[BUFSIZ];
char * fn = buf;
FILE * f;
FD_t fd;
fn = rpmGetPath("%{_builddir}/%{?buildsubdir:%{buildsubdir}/}", file, NULL);
fd = Fopen(fn, "r.ufdio");
f = fopen(fn, "r");
if (fn != buf) fn = _free(fn);
if (fd == NULL || Ferror(fd)) {
if (f == NULL || ferror(f)) {
sb = freeStringBuf(sb);
return NULL;
}
if ((f = fdGetFILE(fd)) != NULL)
while (fgets(buf, sizeof(buf), f)) {
/* XXX display fn in error msg */
if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {
@ -135,7 +133,7 @@ static StringBuf addFileToTagAux(rpmSpec spec,
}
appendStringBuf(sb, buf);
}
(void) Fclose(fd);
(void) fclose(f);
return sb;
}