mirror of
https://repo.or.cz/socat.git
synced 2024-12-22 23:42:34 +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
4
CHANGES
4
CHANGES
|
@ -43,6 +43,10 @@ Porting:
|
||||||
IP_ADD_SOURCE_MEMBERSHIP but not struct ip_mreq_source
|
IP_ADD_SOURCE_MEMBERSHIP but not struct ip_mreq_source
|
||||||
Thanks to Justin Yackoski for sending a patch.
|
Thanks to Justin Yackoski for sending a patch.
|
||||||
|
|
||||||
|
configure.ac's detection of getprotobynumber_r() variant did not
|
||||||
|
recognize if this function does not exist, e.g. on Musl libc.
|
||||||
|
Thanks to Alexander Kanavin and Baruch Siach for sending patches.
|
||||||
|
|
||||||
Testing:
|
Testing:
|
||||||
Unset SOCAT_MAIN_WAIT on informational Socat calls
|
Unset SOCAT_MAIN_WAIT on informational Socat calls
|
||||||
|
|
||||||
|
|
|
@ -137,13 +137,13 @@ AC_MSG_RESULT($sc_cv_have_prototype_hstrerror)
|
||||||
# getprotobynumber_r() is not standardized
|
# getprotobynumber_r() is not standardized
|
||||||
AC_MSG_CHECKING(for getprotobynumber_r() variant)
|
AC_MSG_CHECKING(for getprotobynumber_r() variant)
|
||||||
AC_CACHE_VAL(sc_cv_getprotobynumber_r,
|
AC_CACHE_VAL(sc_cv_getprotobynumber_r,
|
||||||
[AC_TRY_COMPILE([#include <stddef.h>
|
[AC_TRY_LINK([#include <stddef.h>
|
||||||
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024,NULL);],
|
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024,NULL);],
|
||||||
[sc_cv_getprotobynumber_r=1; tmp_bynum_variant=Linux],
|
[sc_cv_getprotobynumber_r=1; tmp_bynum_variant=Linux],
|
||||||
[AC_TRY_COMPILE([#include <stddef.h>
|
[AC_TRY_LINK([#include <stddef.h>
|
||||||
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024);],
|
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL,1024);],
|
||||||
[sc_cv_getprotobynumber_r=2; tmp_bynum_variant=Solaris],
|
[sc_cv_getprotobynumber_r=2; tmp_bynum_variant=Solaris],
|
||||||
[AC_TRY_COMPILE([#include <stddef.h>
|
[AC_TRY_LINK([#include <stddef.h>
|
||||||
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL);],
|
#include <netdb.h>],[getprotobynumber_r(1,NULL,NULL);],
|
||||||
[sc_cv_getprotobynumber_r=3; tmp_bynum_variant=AIX],
|
[sc_cv_getprotobynumber_r=3; tmp_bynum_variant=AIX],
|
||||||
|
|
||||||
|
|
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));
|
strncpy(protoname, protoentp->p_name, sizeof(protoname));
|
||||||
#elif HAVE_GETPROTOBYNUMBER_R==2 /* Solaris */
|
#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 */
|
#elif HAVE_GETPROTOBYNUMBER_R==3 /* AIX */
|
||||||
{
|
{
|
||||||
struct protoent_data proto_data;
|
struct protoent_data proto_data;
|
||||||
|
|
2
filan.c
2
filan.c
|
@ -917,7 +917,7 @@ int tcpan2(int fd, FILE *outfile) {
|
||||||
fd, &tcpinfo, sizeof(tcpinfo), strerror(errno));
|
fd, &tcpinfo, sizeof(tcpinfo), strerror(errno));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fprintf(outfile, "%s={%u}\t", "TCPI_STATE", tcpinfo.tcpi_state);
|
fprintf(outfile, "%s={%u}\t", "TCPI_STATE", tcpinfo.tcpi_state);
|
||||||
#if 0 /* on BSD these components are prefixed with __ - I get tired... */
|
#if 0 /* on BSD these components are prefixed with __ - I get tired... */
|
||||||
fprintf(outfile, "%s={%u}\t", "TCPI_CA_STATE", tcpinfo.tcpi_ca_state);
|
fprintf(outfile, "%s={%u}\t", "TCPI_CA_STATE", tcpinfo.tcpi_ca_state);
|
||||||
fprintf(outfile, "%s={%u}\t", "TCPI_RETRANSMITS", tcpinfo.tcpi_retransmits);
|
fprintf(outfile, "%s={%u}\t", "TCPI_RETRANSMITS", tcpinfo.tcpi_retransmits);
|
||||||
|
|
Loading…
Reference in a new issue