From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org> To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com Subject: [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr Date: Fri, 1 Mar 2019 00:27:27 +0300 [thread overview] Message-ID: <cac6a9254da76249d3b043121d73ec9447201290.1551389218.git.v.shpilevoy@tarantool.org> (raw) SWIM module API is going to provide a set of clear and pure functions with appropriately settled const qualifiers. And it wants to use sio_strfaddr() to provide to user an easy way to get a pointer to URI of a SWIM member stored in a const memory. It requires this two-line modification of sio module. --- Branch: https://github.com/tarantool/tarantool/tree/gerold103/sio-const src/lib/core/sio.c | 2 +- src/lib/core/sio.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core/sio.c b/src/lib/core/sio.c index 7ea13f736..bb8e508d9 100644 --- a/src/lib/core/sio.c +++ b/src/lib/core/sio.c @@ -294,7 +294,7 @@ sio_getpeername(int fd, struct sockaddr *addr, socklen_t *addrlen) } const char * -sio_strfaddr(struct sockaddr *addr, socklen_t addrlen) +sio_strfaddr(const struct sockaddr *addr, socklen_t addrlen) { static __thread char name[NI_MAXHOST + _POSIX_PATH_MAX + 2]; switch (addr->sa_family) { diff --git a/src/lib/core/sio.h b/src/lib/core/sio.h index 27988a232..19fbe0bb8 100644 --- a/src/lib/core/sio.h +++ b/src/lib/core/sio.h @@ -71,7 +71,7 @@ sio_wouldblock(int err) * May garble errno. Used for error reporting. */ const char * -sio_strfaddr(struct sockaddr *addr, socklen_t addrlen); +sio_strfaddr(const struct sockaddr *addr, socklen_t addrlen); /** * Return a filled in struct sockaddr provided the file -- 2.17.2 (Apple Git-113)
next reply other threads:[~2019-02-28 21:27 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-28 21:27 Vladislav Shpilevoy [this message] 2019-02-28 21:58 ` [tarantool-patches] " Konstantin Osipov 2019-03-01 9:40 ` [tarantool-patches] " Vladislav Shpilevoy
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=cac6a9254da76249d3b043121d73ec9447201290.1551389218.git.v.shpilevoy@tarantool.org \ --to=v.shpilevoy@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox