mirror of
https://repo.or.cz/socat.git
synced 2025-01-24 19:49:27 +00:00
Merge /home/gerhard/Develop/socat-hpux into socat-1.7.0.0
This commit is contained in:
commit
6334ce1a62
5 changed files with 18 additions and 1 deletions
|
@ -331,7 +331,7 @@
|
||||||
/* Define if you have struct ifreq.ifr_index */
|
/* Define if you have struct ifreq.ifr_index */
|
||||||
#undef HAVE_STRUCT_IFREQ_IFR_INDEX
|
#undef HAVE_STRUCT_IFREQ_IFR_INDEX
|
||||||
|
|
||||||
/* Define if you have struct ifreq.ifr_ifindex */
|
/* Define if you have struct ifreq.ifr_ifindex; not on HPUX */
|
||||||
#undef HAVE_STRUCT_IFREQ_IFR_IFINDEX
|
#undef HAVE_STRUCT_IFREQ_IFR_IFINDEX
|
||||||
|
|
||||||
/* Define if your struct sockaddr has sa_len */
|
/* Define if your struct sockaddr has sa_len */
|
||||||
|
@ -364,6 +364,9 @@
|
||||||
/* Define if you have the setenv function */
|
/* Define if you have the setenv function */
|
||||||
#undef HAVE_SETENV
|
#undef HAVE_SETENV
|
||||||
|
|
||||||
|
/* Define if you have the unsetenv function. not on HP-UX */
|
||||||
|
#undef HAVE_UNSETENV
|
||||||
|
|
||||||
/* Define if you have the flock function */
|
/* Define if you have the flock function */
|
||||||
#undef HAVE_FLOCK
|
#undef HAVE_FLOCK
|
||||||
|
|
||||||
|
|
|
@ -1198,6 +1198,9 @@ dnl Search for setenv()
|
||||||
AC_CHECK_FUNC(setenv, AC_DEFINE(HAVE_SETENV),
|
AC_CHECK_FUNC(setenv, AC_DEFINE(HAVE_SETENV),
|
||||||
AC_CHECK_LIB(isode, setenv, [LIBS="-lisode $LIBS"]))
|
AC_CHECK_LIB(isode, setenv, [LIBS="-lisode $LIBS"]))
|
||||||
|
|
||||||
|
dnl Search for unsetenv()
|
||||||
|
AC_CHECK_FUNC(unsetenv, AC_DEFINE(HAVE_UNSETENV))
|
||||||
|
|
||||||
|
|
||||||
dnl Run time checks
|
dnl Run time checks
|
||||||
|
|
||||||
|
|
2
sycls.c
2
sycls.c
|
@ -1459,6 +1459,7 @@ int Setenv(const char *name, const char *value, int overwrite) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_UNSETENV
|
||||||
/* on Linux it returns int but on FreeBSD void.
|
/* on Linux it returns int but on FreeBSD void.
|
||||||
we do not expect many errors, so we take void which works on all systems. */
|
we do not expect many errors, so we take void which works on all systems. */
|
||||||
void Unsetenv(const char *name) {
|
void Unsetenv(const char *name) {
|
||||||
|
@ -1470,6 +1471,7 @@ void Unsetenv(const char *name) {
|
||||||
errno = _errno;
|
errno = _errno;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WITH_READLINE
|
#if WITH_READLINE
|
||||||
|
|
||||||
|
|
|
@ -550,7 +550,9 @@ int xiosetenv(const char *varname, const char *value, int overwrite) {
|
||||||
if (Setenv(envname, value, overwrite) < 0) {
|
if (Setenv(envname, value, overwrite) < 0) {
|
||||||
Warn3("setenv(\"%s\", \"%s\", 1): %s",
|
Warn3("setenv(\"%s\", \"%s\", 1): %s",
|
||||||
envname, value, strerror(errno));
|
envname, value, strerror(errno));
|
||||||
|
#if HAVE_UNSETENV
|
||||||
Unsetenv(envname); /* dont want to have a wrong value */
|
Unsetenv(envname); /* dont want to have a wrong value */
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -579,7 +581,9 @@ int xiosetenv2(const char *varname, const char *varname2, const char *value,
|
||||||
if (Setenv(envname, value, overwrite) < 0) {
|
if (Setenv(envname, value, overwrite) < 0) {
|
||||||
Warn3("setenv(\"%s\", \"%s\", 1): %s",
|
Warn3("setenv(\"%s\", \"%s\", 1): %s",
|
||||||
envname, value, strerror(errno));
|
envname, value, strerror(errno));
|
||||||
|
#if HAVE_UNSETENV
|
||||||
Unsetenv(envname); /* dont want to have a wrong value */
|
Unsetenv(envname); /* dont want to have a wrong value */
|
||||||
|
#endif
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1869,8 +1869,13 @@ char *xiogetifname(int ind, char *val, int ins) {
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIOCGIFNAME
|
#ifdef SIOCGIFNAME
|
||||||
if(Ioctl(s, SIOCGIFNAME, &ifr) < 0) {
|
if(Ioctl(s, SIOCGIFNAME, &ifr) < 0) {
|
||||||
|
#if HAVE_STRUCT_IFREQ_IFR_INDEX
|
||||||
|
Info3("ioctl(%d, SIOCGIFNAME, {..., ifr_index=%d, ...}: %s",
|
||||||
|
s, ifr.ifr_index, strerror(errno));
|
||||||
|
#elif HAVE_STRUCT_IFREQ_IFR_IFINDEX
|
||||||
Info3("ioctl(%d, SIOCGIFNAME, {..., ifr_ifindex=%d, ...}: %s",
|
Info3("ioctl(%d, SIOCGIFNAME, {..., ifr_ifindex=%d, ...}: %s",
|
||||||
s, ifr.ifr_ifindex, strerror(errno));
|
s, ifr.ifr_ifindex, strerror(errno));
|
||||||
|
#endif
|
||||||
if (ins < 0) Close(s);
|
if (ins < 0) Close(s);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue