- fopen() returns NULL on errors, never an opened stream with error
flag set. These are leftovers from past where rpmio fd was used
instead of FILE and probably the checks were bogus even back then too.
}
fd = fopen(ffn, "r");
- if (fd == NULL || ferror(fd)) {
+ if (fd == NULL) {
rpmlog(RPMLOG_ERR, _("Could not open %%files file %s: %m\n"), ffn);
return RPMRC_FAIL;
}
fn = rpmGetPath("%{_builddir}/%{?buildsubdir:%{buildsubdir}/}", file, NULL);
f = fopen(fn, "r");
- if (f == NULL || ferror(f)) {
+ if (f == NULL) {
sb = freeStringBuf(sb);
goto exit;
}
/* Make sure the current file is open */
if (ofi->fp == NULL) {
ofi->fp = fopen(ofi->fileName, "r");
- if (ofi->fp == NULL || ferror(ofi->fp)) {
- /* XXX Fstrerror */
+ if (ofi->fp == NULL) {
rpmlog(RPMLOG_ERR, _("Unable to open %s: %s\n"),
ofi->fileName, strerror(errno));
return PART_ERROR;
int checking;
f = fopen(specfile, "r");
- if (f == NULL || ferror(f)) {
+ if (f == NULL) {
rpmlog(RPMLOG_ERR, _("Unable to open spec file %s: %s\n"),
specfile, strerror(errno));
return 0;
char *buf = xmalloc(blen);
int rc = -1;
- if (fd == NULL || ferror(fd)) {
- if (fd) (void) fclose(fd);
+ if (fd == NULL)
goto exit;
- }
/* XXX Assume new fangled macro expansion */
max_macro_depth = 16;