From 6511823c97c6f40b8d99961767537f4f3bebc16e Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 14 Apr 2020 11:27:46 +0200
Subject: [PATCH] ndb: make rpmxdbWriteHeader a void function

It's a static function and nobody tests the return code. It just
writes into mapped memory like rpmxdbUpdateSlot, which is also void.

URL:https://github.com/rpm-software-management/rpm/commit/6511823c97c6f40b8d99961767537f4f3bebc16e
---
 lib/backend/ndb/rpmxdb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/backend/ndb/rpmxdb.c b/lib/backend/ndb/rpmxdb.c
index ab22746..be85fdc 100644
--- a/lib/backend/ndb/rpmxdb.c
+++ b/lib/backend/ndb/rpmxdb.c
@@ -392,17 +392,14 @@ static int rpmxdbReadHeader(rpmxdb xdb, int rw)
     return RPMRC_OK;
 }
 
-static int rpmxdbWriteHeader(rpmxdb xdb)
+static void rpmxdbWriteHeader(rpmxdb xdb)
 {
-    if (!xdb->mapped)
-	return RPMRC_FAIL;
     h2lea(XDB_MAGIC, xdb->mapped + XDB_OFFSET_MAGIC);
     h2lea(XDB_VERSION, xdb->mapped + XDB_OFFSET_VERSION);
     h2lea(xdb->generation, xdb->mapped + XDB_OFFSET_GENERATION);
     h2lea(xdb->slotnpages, xdb->mapped + XDB_OFFSET_SLOTNPAGES);
     h2lea(xdb->pagesize, xdb->mapped + XDB_OFFSET_PAGESIZE);
     h2lea(xdb->usergeneration, xdb->mapped + XDB_OFFSET_USERGENERATION);
-    return RPMRC_OK;
 }
 
 static void rpmxdbUpdateSlot(rpmxdb xdb, struct xdb_slot *slot)
-- 
1.8.3.1

