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 --- CONTRIBUTING | 5 +++++ COPYING | 2 +- DCO | 37 +++++++++++++++++++++++++++++++++++++ doc/index.html | 2 +- src/misc/skabus-dynteed.c | 21 +++++---------------- src/pub/skabus-pubd.c | 20 ++++---------------- src/rpc/skabus-rpcd.c | 20 ++++---------------- 7 files changed, 57 insertions(+), 50 deletions(-) create mode 100644 CONTRIBUTING create mode 100644 DCO diff --git a/CONTRIBUTING b/CONTRIBUTING new file mode 100644 index 0000000..6279422 --- /dev/null +++ b/CONTRIBUTING @@ -0,0 +1,5 @@ + Please add a Signed-Off-By: line at the end of your commit, +which certifies that you have the right and authority to pass +it on as an open-source patch, as explicited in the Developer's +Certificate of Origin available in this project's DCO file, +or at https://developercertificate.org/ diff --git a/COPYING b/COPYING index b46b08c..b2bed15 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright (c) 2017-2020 Laurent Bercot +Copyright (c) 2017-2021 Laurent Bercot Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/DCO b/DCO new file mode 100644 index 0000000..8201f99 --- /dev/null +++ b/DCO @@ -0,0 +1,37 @@ +Developer Certificate of Origin +Version 1.1 + +Copyright (C) 2004, 2006 The Linux Foundation and its contributors. +1 Letterman Drive +Suite D4700 +San Francisco, CA, 94129 + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + + +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the best + of my knowledge, is covered under an appropriate open source + license and I have the right under that license to submit that + work with modifications, whether created in whole or in part + by me, under the same open source license (unless I am + permitted to submit under a different license), as indicated + in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including all + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + this project or the open source license(s) involved. diff --git a/doc/index.html b/doc/index.html index f22c483..e5f0953 100644 --- a/doc/index.html +++ b/doc/index.html @@ -131,7 +131,7 @@ relevant page.
  • skabus is discussed on the -skaware mailing-list.
  • +skaware mailing-list.

Similar work

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) ; } 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) ; } diff --git a/src/rpc/skabus-rpcd.c b/src/rpc/skabus-rpcd.c index d39bc52..9535887 100644 --- a/src/rpc/skabus-rpcd.c +++ b/src/rpc/skabus-rpcd.c @@ -48,8 +48,7 @@ static tain_t lameduckdeadline = TAIN_INFINITE_RELATIVE ; 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 inline void handle_signals (void) { @@ -68,19 +67,10 @@ static inline 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 ; @@ -445,9 +435,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.2.3