From: Willy Tarreau Date: Wed, 6 Mar 2013 14:08:16 +0000 (+0100) Subject: CLEANUP: tools: remove str2sun() which is not used anymore. X-Git-Tag: v1.5-dev18~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=add0ab19759379b44b333e746225002e9032be4a;p=thirdparty%2Fhaproxy.git CLEANUP: tools: remove str2sun() which is not used anymore. --- diff --git a/include/common/standard.h b/include/common/standard.h index 4bc656db6a..59997db94b 100644 --- a/include/common/standard.h +++ b/include/common/standard.h @@ -211,12 +211,6 @@ extern const char *invalid_char(const char *name); */ extern const char *invalid_domainchar(const char *name); -/* - * converts to a struct sockaddr_un* which is locally allocated. - * The format is "/path", where "/path" is a path to a UNIX domain socket. - */ -struct sockaddr_un *str2sun(const char *str); - /* * converts to a struct sockaddr_storage* which is locally allocated. The * string is assumed to contain only an address, no port. The address can be a diff --git a/src/standard.c b/src/standard.c index 833d91a4c6..2236b55ad0 100644 --- a/src/standard.c +++ b/src/standard.c @@ -442,27 +442,6 @@ const char *limit_r(unsigned long n, char *buffer, int size, const char *alt) return (n) ? ultoa_r(n, buffer, size) : (alt ? alt : ""); } -/* - * converts to a struct sockaddr_un* which is locally allocated. - * The format is "/path", where "/path" is a path to a UNIX domain socket. - * NULL is returned if the socket path is invalid (too long). - */ -struct sockaddr_un *str2sun(const char *str) -{ - static struct sockaddr_un su; - int strsz; /* length included null */ - - memset(&su, 0, sizeof(su)); - strsz = strlen(str) + 1; - if (strsz > sizeof(su.sun_path)) { - return NULL; - } else { - su.sun_family = AF_UNIX; - memcpy(su.sun_path, str, strsz); - } - return &su; -} - /* * Returns non-zero if character is a hex digit (0-9, a-f, A-F), else zero. *