Log an error on short lead (RhBug:511101)
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 14 Jul 2009 11:25:58 +0000 (14:25 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 14 Jul 2009 11:25:58 +0000 (14:25 +0300)
- if lead read returns short without it being an IO error, treat it
  as a case of "not an rpm package"

lib/rpmlead.c

index 7c21e26..14487f2 100644 (file)
@@ -123,8 +123,10 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead)
            rpmlog(RPMLOG_ERR, _("read failed: %s (%d)\n"),
                        Fstrerror(fd), errno);
            return RPMRC_FAIL;
+       } else {
+           rpmlog(RPMLOG_ERR, _("not an rpm package\n"));
+           return RPMRC_NOTFOUND;
        }
-       return RPMRC_NOTFOUND;
     }
     lead->type = ntohs(lead->type);
     lead->archnum = ntohs(lead->archnum);