mirror of
https://repo.or.cz/socat.git
synced 2025-07-19 09:22:57 +00:00
Correction of getprotobynumber_r() variant detection (musl libc)
This commit is contained in:
parent
ee23bccee7
commit
75cb44bc90
4 changed files with 14 additions and 6 deletions
8
fdname.c
8
fdname.c
|
@ -261,8 +261,12 @@ int sockname(int fd, FILE *outfile, char style) {
|
|||
}
|
||||
strncpy(protoname, protoentp->p_name, sizeof(protoname));
|
||||
#elif HAVE_GETPROTOBYNUMBER_R==2 /* Solaris */
|
||||
protoentp = getprotobynumber(proto);
|
||||
strncpy(protoname, protoentp->p_name, sizeof(protoname));
|
||||
{
|
||||
# define FILAN_GETPROTOBYNUMBER_R_BUFLEN 1024
|
||||
char buffer[FILAN_GETPROTOBYNUMBER_R_BUFLEN];
|
||||
protoentp = getprotobynumber_r(proto, &protoent, buffer, FILAN_GETPROTOBYNUMBER_R_BUFLEN);
|
||||
strncpy(protoname, protoentp->p_name, sizeof(protoname));
|
||||
}
|
||||
#elif HAVE_GETPROTOBYNUMBER_R==3 /* AIX */
|
||||
{
|
||||
struct protoent_data proto_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue