summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-16 13:36:39 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-16 13:36:39 +0300
commitf677a821adf7d18f5e9a9b053d805052a1bf5a39 (patch)
treeba5d30c30542dadd650c658c2e3f92dd64173a80 /build
parentb0d1038190be5cb4b45e2c2c7c84ee7022164ba2 (diff)
downloadrpm-f677a821adf7d18f5e9a9b053d805052a1bf5a39.tar.gz
rpm-f677a821adf7d18f5e9a9b053d805052a1bf5a39.tar.bz2
rpm-f677a821adf7d18f5e9a9b053d805052a1bf5a39.zip
Since we really want a FILE* then get one in the first place
- this is visible in the librpmbuild exported goo, rename the member to force build-breakage on the poor souls trying to use librpmbuild API
Diffstat (limited to 'build')
-rw-r--r--build/parseSpec.c15
-rw-r--r--build/rpmspec.h2
-rw-r--r--build/spec.c2
3 files changed, 9 insertions, 10 deletions
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 3c5349d1e..816aa814d 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -210,12 +210,12 @@ static int readLineFromOFI(rpmSpec spec, OFI_t *ofi)
{
retry:
/* Make sure the current file is open */
- if (ofi->fd == NULL) {
- ofi->fd = Fopen(ofi->fileName, "r.fpio");
- if (ofi->fd == NULL || Ferror(ofi->fd)) {
+ if (ofi->fp == NULL) {
+ ofi->fp = fopen(ofi->fileName, "r");
+ if (ofi->fp == NULL || ferror(ofi->fp)) {
/* XXX Fstrerror */
rpmlog(RPMLOG_ERR, _("Unable to open %s: %s\n"),
- ofi->fileName, Fstrerror(ofi->fd));
+ ofi->fileName, strerror(errno));
return PART_ERROR;
}
spec->lineNum = ofi->lineNum = 0;
@@ -223,8 +223,7 @@ retry:
/* Make sure we have something in the read buffer */
if (!(ofi->readPtr && *(ofi->readPtr))) {
- FILE * f = fdGetFILE(ofi->fd);
- if (f == NULL || !fgets(ofi->readBuf, BUFSIZ, f)) {
+ if (!fgets(ofi->readBuf, BUFSIZ, ofi->fp)) {
/* EOF */
if (spec->readStack->next) {
rpmlog(RPMLOG_ERR, _("Unclosed %%if\n"));
@@ -233,7 +232,7 @@ retry:
/* remove this file from the stack */
spec->fileStack = ofi->next;
- (void) Fclose(ofi->fd);
+ fclose(ofi->fp);
ofi->fileName = _free(ofi->fileName);
ofi = _free(ofi);
@@ -394,7 +393,7 @@ void closeSpec(rpmSpec spec)
while (spec->fileStack) {
ofi = spec->fileStack;
spec->fileStack = spec->fileStack->next;
- if (ofi->fd) (void) Fclose(ofi->fd);
+ if (ofi->fp) (void) fclose(ofi->fp);
ofi->fileName = _free(ofi->fileName);
ofi = _free(ofi);
}
diff --git a/build/rpmspec.h b/build/rpmspec.h
index eb9411875..c94467716 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -55,7 +55,7 @@ typedef struct ReadLevelEntry {
*/
typedef struct OpenFileInfo {
char * fileName;
- FD_t fd;
+ FILE *fp;
int lineNum;
char readBuf[BUFSIZ];
char * readPtr;
diff --git a/build/spec.c b/build/spec.c
index a867500ad..d3e6a6a8d 100644
--- a/build/spec.c
+++ b/build/spec.c
@@ -530,7 +530,7 @@ struct OpenFileInfo * newOpenFileInfo(void)
struct OpenFileInfo *ofi;
ofi = xmalloc(sizeof(*ofi));
- ofi->fd = NULL;
+ ofi->fp = NULL;
ofi->fileName = NULL;
ofi->lineNum = 0;
ofi->readBuf[0] = '\0';