mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-05 04:56:10 +02:00
CLEANUP: tools: remove str2sun() which is not used anymore.
This commit is contained in:
parent
9b435bcdfe
commit
add0ab1975
@ -211,12 +211,6 @@ extern const char *invalid_char(const char *name);
|
||||
*/
|
||||
extern const char *invalid_domainchar(const char *name);
|
||||
|
||||
/*
|
||||
* converts <str> 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 <str> 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
|
||||
|
||||
@ -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 <str> 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 <s> is a hex digit (0-9, a-f, A-F), else zero.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user