From bc13afbbfdfa33b10bb87e9503b3b06a0d65bfd2 Mon Sep 17 00:00:00 2001
From: Michael Schroeder <mls@suse.de>
Date: Tue, 14 Jan 2020 17:05:27 +0100
Subject: [PATCH] ndb: fix ftruncate return value warning

URL:https://github.com/rpm-software-management/rpm/commit/bc13afbbfdfa33b10bb87e9503b3b06a0d65bfd2
---
 lib/backend/ndb/rpmxdb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/backend/ndb/rpmxdb.c b/lib/backend/ndb/rpmxdb.c
index 3baafa6..dbd4942 100644
--- a/lib/backend/ndb/rpmxdb.c
+++ b/lib/backend/ndb/rpmxdb.c
@@ -963,7 +963,9 @@ int rpmxdbDelAllBlobs(rpmxdb xdb)
 	rpmxdbUnlock(xdb, 1);
 	return RPMRC_FAIL;
     }
-    ftruncate(xdb->fd, xdb->pagesize);
+    if (ftruncate(xdb->fd, xdb->pagesize)) {
+	/* ftruncate failed, but that is not a problem */
+    }
     rpmxdbUnlock(xdb, 1);
     return RPMRC_OK;
 }
-- 
1.8.3.1

