diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2021-07-24 15:12:02 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2021-07-24 15:12:02 +0000 |
commit | 6b13dbadb14e21074e9a54d284b4757337c7c009 (patch) | |
tree | 8b210307542517a22c42bf76e5d84f8e2ce3a2be | |
parent | 914de087ec86dca51c6d801f64ca761d3563238a (diff) | |
download | skabus-6b13dbadb14e21074e9a54d284b4757337c7c009.tar.xz |
Add DCO, adapt to skalibs-2.11.0.0
Signed-off-by: Laurent Bercot <ska@appnovation.com>
-rw-r--r-- | CONTRIBUTING | 5 | ||||
-rw-r--r-- | COPYING | 2 | ||||
-rw-r--r-- | DCO | 37 | ||||
-rw-r--r-- | doc/index.html | 2 | ||||
-rw-r--r-- | src/misc/skabus-dynteed.c | 21 | ||||
-rw-r--r-- | src/pub/skabus-pubd.c | 20 | ||||
-rw-r--r-- | src/rpc/skabus-rpcd.c | 20 |
7 files changed, 57 insertions, 50 deletions
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/ @@ -1,4 +1,4 @@ -Copyright (c) 2017-2020 Laurent Bercot <ska-skaware@skarnet.org> +Copyright (c) 2017-2021 Laurent Bercot <ska-skaware@skarnet.org> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -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. <ul> <li> <tt>skabus</tt> is discussed on the -<a href="//skarnet.org/lists.html#skaware">skaware</a> mailing-list. </li> +<a href="//skarnet.org/lists/#skaware">skaware</a> mailing-list. </li> </ul> <h3> Similar work </h3> 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 <fcntl.h> #include <errno.h> #include <signal.h> + #include <skalibs/types.h> #include <skalibs/siovec.h> #include <skalibs/allreadwrite.h> @@ -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) ; } |