From 1b862f3b7c489928f1861396cebb763ae0654371 Mon Sep 17 00:00:00 2001
From: Steve Grubb <sgrubb@redhat.com>
Date: Wed, 3 Mar 2021 13:22:10 -0500
Subject: [PATCH] Add error message for debugging
---
src/library/database.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/library/database.c b/src/library/database.c
index 9497c06..831ec74 100644
--- a/src/library/database.c
+++ b/src/library/database.c
@@ -713,12 +713,17 @@ static int check_database_copy(void)
*/
void unlink_db(void)
{
+ int rc;
char path[64];
snprintf(path, sizeof(path), "%s/data.mdb", data_dir);
- unlink(path);
+ rc = unlink(path);
+ if (rc)
+ msg(LOG_ERR, "Could not unlink %s (%s)", path, strerror(errno));
snprintf(path, sizeof(path), "%s/lock.mdb", data_dir);
- unlink(path);
+ rc = unlink(path);
+ if (rc)
+ msg(LOG_ERR, "Could not unlink %s (%s)", path, strerror(errno));
}