From 6b13dbadb14e21074e9a54d284b4757337c7c009 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 24 Jul 2021 15:12:02 +0000 Subject: Add DCO, adapt to skalibs-2.11.0.0 Signed-off-by: Laurent Bercot --- src/misc/skabus-dynteed.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/misc/skabus-dynteed.c') diff --git a/src/misc/skabus-dynteed.c b/src/misc/skabus-dynteed.c index afe8e82..90e0fe8 100644 --- a/src/misc/skabus-dynteed.c +++ b/src/misc/skabus-dynteed.c @@ -9,6 +9,7 @@ #include #include #include + #include #include #include @@ -38,8 +39,7 @@ static tain_t lameduckdeadline ; 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 ; typedef struct client_s client_t, *client_t_ref ; struct client_s @@ -72,19 +72,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 ; @@ -170,9 +161,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) ; } -- cgit v1.3.1