From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Vladislav Shpilevoy Subject: [PATCH 1/1] sio: make sio_strfaddr taking const struct sockaddr Date: Fri, 1 Mar 2019 00:27:27 +0300 Message-Id: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com List-ID: 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)