aboutsummaryrefslogtreecommitdiffstats
path: root/src/pub/skabus-pubd.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-07-24 15:12:02 +0000
committerLaurent Bercot <ska@appnovation.com>2021-07-24 15:12:02 +0000
commit6b13dbadb14e21074e9a54d284b4757337c7c009 (patch)
tree8b210307542517a22c42bf76e5d84f8e2ce3a2be /src/pub/skabus-pubd.c
parent914de087ec86dca51c6d801f64ca761d3563238a (diff)
downloadskabus-6b13dbadb14e21074e9a54d284b4757337c7c009.tar.gz
Add DCO, adapt to skalibs-2.11.0.0
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/pub/skabus-pubd.c')
-rw-r--r--src/pub/skabus-pubd.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/pub/skabus-pubd.c b/src/pub/skabus-pubd.c
index 45adab1..5346717 100644
--- a/src/pub/skabus-pubd.c
+++ b/src/pub/skabus-pubd.c
@@ -58,8 +58,7 @@ static int maxed = 0 ;
static unsigned int rulestype = 0 ;
static char const *rules = 0 ;
-static int cdbfd = -1 ;
-static struct cdb cdbmap = CDB_ZERO ;
+static cdb cdbmap = CDB_ZERO ;
static char const *msgfsdir ;
@@ -80,19 +79,10 @@ static void handle_signals (void)
}
case SIGHUP :
{
- int fd ;
- struct cdb c = CDB_ZERO ;
+ cdb c = CDB_ZERO ;
if (rulestype != 2) break ;
- fd = open_readb(rules) ;
- if (fd < 0) break ;
- if (cdb_init(&c, fd) < 0)
- {
- fd_close(fd) ;
- break ;
- }
+ if (!cdb_init(&c, rules)) break ;
cdb_free(&cdbmap) ;
- fd_close(cdbfd) ;
- cdbfd = fd ;
cdbmap = c ;
}
break ;
@@ -826,9 +816,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (rulestype == 2)
{
- cdbfd = open_readb(rules) ;
- if (cdbfd < 0) strerr_diefu3sys(111, "open ", rules, " for reading") ;
- if (cdb_init(&cdbmap, cdbfd) < 0)
+ if (!cdb_init(&cdbmap, rules))
strerr_diefu2sys(111, "cdb_init ", rules) ;
}