summaryrefslogtreecommitdiff
path: root/lib/rpmlead.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-04-16 17:48:04 +0000
committerjbj <devnull@localhost>2003-04-16 17:48:04 +0000
commitc243ab099b4429a20d1ac00baa3eeae206be4365 (patch)
tree2e12bd05c4e85ca9203582baa74fdfabae5222b9 /lib/rpmlead.c
parent14165bc5582af0306bff6bb42b7c76305bec5abf (diff)
downloadrpm-c243ab099b4429a20d1ac00baa3eeae206be4365.tar.gz
rpm-c243ab099b4429a20d1ac00baa3eeae206be4365.tar.bz2
rpm-c243ab099b4429a20d1ac00baa3eeae206be4365.zip
- resurrect manifests, RPMRC_NOTFOUND returned by readLead().
CVS patchset: 6752 CVS date: 2003/04/16 17:48:04
Diffstat (limited to 'lib/rpmlead.c')
-rw-r--r--lib/rpmlead.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/rpmlead.c b/lib/rpmlead.c
index a679334c3..3f78b6477 100644
--- a/lib/rpmlead.c
+++ b/lib/rpmlead.c
@@ -52,20 +52,23 @@ rpmRC readLead(FD_t fd, struct rpmlead *lead)
/*@=boundswrite@*/
/*@-type@*/ /* FIX: remove timed read */
if (timedRead(fd, (char *)lead, sizeof(*lead)) != sizeof(*lead)) {
- rpmError(RPMERR_READ, _("read failed: %s (%d)\n"), Fstrerror(fd),
- errno);
- return RPMRC_FAIL;
+ if (Ferror(fd)) {
+ rpmError(RPMERR_READ, _("read failed: %s (%d)\n"),
+ Fstrerror(fd), errno);
+ return RPMRC_FAIL;
+ }
+ return RPMRC_NOTFOUND;
}
/*@=type@*/
if (memcmp(lead->magic, lead_magic, sizeof(lead_magic)))
- return RPMRC_FAIL;
+ return RPMRC_NOTFOUND;
lead->type = ntohs(lead->type);
lead->archnum = ntohs(lead->archnum);
lead->osnum = ntohs(lead->osnum);
lead->signature_type = ntohs(lead->signature_type);
if (lead->signature_type != RPMSIGTYPE_HEADERSIG)
- return RPMRC_FAIL;
+ return RPMRC_NOTFOUND;
return RPMRC_OK;
}