summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-04-18 12:25:43 +0300
committerPanu Matilainen <pmatilai@redhat.com>2011-04-18 12:25:43 +0300
commitf6579c0ac3af9d3f4ccdb087a671e06c85efd705 (patch)
tree9b228bf73aa2f52cbdb3c686ba8f3242e678b404 /tools
parenta1ea30c5c703a24ad29d4c497021b993d0be8943 (diff)
downloadrpm-f6579c0ac3af9d3f4ccdb087a671e06c85efd705.tar.gz
Reflect file classifier errors in rpmdeps exit code
- rpmfcClassify() or rpmfcApply() failing is pretty fatal to rpmdeps, exit with error code - OTOH argvAdd() and argvSort() can't really fail, ignore their return codes, shutting up another set-but-not-used whine
Diffstat (limited to 'tools')
-rw-r--r--tools/rpmdeps.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/rpmdeps.c b/tools/rpmdeps.c
index 94513f1cd..438209c85 100644
--- a/tools/rpmdeps.c
+++ b/tools/rpmdeps.c
@@ -50,7 +50,6 @@ main(int argc, char *argv[])
rpmfc fc;
int ac = 0;
int ec = 1;
- int xx;
char buf[BUFSIZ];
if ((progname = strrchr(argv[0], '/')) != NULL)
@@ -73,20 +72,19 @@ char buf[BUFSIZ];
be = b + strlen(buf) - 1;
while (strchr("\r\n", *be) != NULL)
*be-- = '\0';
- xx = argvAdd(&av, b);
+ argvAdd(&av, b);
}
ac = argvCount(av);
}
/* Make sure file names are sorted. */
- xx = argvSort(av, NULL);
+ argvSort(av, NULL);
- /* Build file class dictionary. */
- fc = rpmfcCreate(getenv("RPM_BUILD_ROOT"), 0);
- xx = rpmfcClassify(fc, av, NULL);
- /* Build file/package dependency dictionary. */
- xx = rpmfcApply(fc);
+ /* Build file/package class and dependency dictionaries. */
+ fc = rpmfcCreate(getenv("RPM_BUILD_ROOT"), 0);
+ if (rpmfcClassify(fc, av, NULL) || rpmfcApply(fc))
+ goto exit;
if (_rpmfc_debug) {
rpmfcPrint(buf, fc, NULL);