ifix pedantic usage address_len parameter in accept(2) - geomyidae - A small C-based gopherd. Err bitreich.org 70 hgit clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ URL:git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ bitreich.org 70 1Log /scm/geomyidae/log.gph bitreich.org 70 1Files /scm/geomyidae/files.gph bitreich.org 70 1Refs /scm/geomyidae/refs.gph bitreich.org 70 1Tags /scm/geomyidae/tag bitreich.org 70 1README /scm/geomyidae/file/README.gph bitreich.org 70 1LICENSE /scm/geomyidae/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit f02d57cfae2c18951b665353b21aed02d29731a9 /scm/geomyidae/commit/f02d57cfae2c18951b665353b21aed02d29731a9.gph bitreich.org 70 1parent cb9b6b70dbc6b33cc29364ba31023ffeb0579085 /scm/geomyidae/commit/cb9b6b70dbc6b33cc29364ba31023ffeb0579085.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Wed, 29 Aug 2018 20:22:19 +0200 Err bitreich.org 70 i Err bitreich.org 70 ifix pedantic usage address_len parameter in accept(2) Err bitreich.org 70 i Err bitreich.org 70 iPOSIX says regarding `address_len`: Err bitreich.org 70 i"on input specifies the length of the supplied sockaddr structure, and on Err bitreich.org 70 ioutput specifies the length of the stored address." Err bitreich.org 70 i Err bitreich.org 70 iSo it should be set to the sizeof the used structure. Err bitreich.org 70 i Err bitreich.org 70 iSigned-off-by: Christoph Lohmann <20h@r-36.net> Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M main.c | 3 +-- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 1 insertion(+), 2 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/main.c b/main.c /scm/geomyidae/file/main.c.gph bitreich.org 70 i@@ -533,8 +533,6 @@ main(int argc, char *argv[]) Err bitreich.org 70 i Err bitreich.org 70 i initsignals(); Err bitreich.org 70 i Err bitreich.org 70 i- cltlen = sizeof(clt); Err bitreich.org 70 i- Err bitreich.org 70 i #ifdef __OpenBSD__ Err bitreich.org 70 i char promises[31]; /* check the size needed in the fork too */ Err bitreich.org 70 i snprintf(promises, sizeof(promises), "rpath inet stdio proc exec %s", Err bitreich.org 70 i@@ -546,6 +544,7 @@ main(int argc, char *argv[]) Err bitreich.org 70 i #endif /* __OpenBSD__ */ Err bitreich.org 70 i Err bitreich.org 70 i while (1) { Err bitreich.org 70 i+ cltlen = sizeof(clt); Err bitreich.org 70 i sock = accept(listfd, (struct sockaddr *)&clt, &cltlen); Err bitreich.org 70 i if (sock < 0) { Err bitreich.org 70 i switch (errno) { Err bitreich.org 70 .