From b021491203fe6e036b5d1f13be368ae644f16312 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 18 Apr 2011 12:04:34 +0300 Subject: [PATCH] Collect proper exit status from rpmdbRemoveDatabase() - The single caller doesn't actually care about its exit code as its not particularly important in that case but .. shrug, at least it silences a warning. --- lib/rpmdb.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/rpmdb.c b/lib/rpmdb.c index b7603d6..8ff930f 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -2752,24 +2752,23 @@ static int cleanDbenv(const char *prefix, const char *dbpath) static int rpmdbRemoveDatabase(const char * prefix, const char * dbpath) { - int i; char *path; - int xx; + int xx = 0; - for (i = 0; i < dbiTagsMax; i++) { + for (int i = 0; i < dbiTagsMax; i++) { const char * base = rpmTagGetName(dbiTags[i]); path = rpmGetPath(prefix, "/", dbpath, "/", base, NULL); if (access(path, F_OK) == 0) - xx = unlink(path); + xx += unlink(path); free(path); } cleanDbenv(prefix, dbpath); path = rpmGetPath(prefix, "/", dbpath, NULL); - xx = rmdir(path); + xx += rmdir(path); free(path); - return 0; + return (xx != 0); } static int rpmdbMoveDatabase(const char * prefix, -- 2.7.4