Return error codes from rpmdsRpmlib()
authorPanu Matilainen <pmatilai@redhat.com>
Fri, 4 Mar 2011 11:08:17 +0000 (13:08 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Fri, 4 Mar 2011 11:08:17 +0000 (13:08 +0200)
- It can fail with eg NULL dsp passed, might as well return something
  which also silences gcc

lib/rpmds.c

index c9c3b5d..80b54f2 100644 (file)
@@ -917,17 +917,17 @@ int rpmdsRpmlib(rpmds * dsp, const void * tblp)
 {
     const struct rpmlibProvides_s * rltblp = tblp;
     const struct rpmlibProvides_s * rlp;
-    int xx;
+    int rc = 0;
 
     if (rltblp == NULL)
        rltblp = rpmlibProvides;
 
-    for (rlp = rltblp; rlp->featureName != NULL; rlp++) {
+    for (rlp = rltblp; rlp->featureName != NULL && rc == 0; rlp++) {
        rpmds ds = rpmdsSingle(RPMTAG_PROVIDENAME, rlp->featureName,
                        rlp->featureEVR, rlp->featureFlags);
-       xx = rpmdsMerge(dsp, ds);
+       rc = rpmdsMerge(dsp, ds);
        ds = rpmdsFree(ds);
     }
-    return 0;
+    return rc;
 }