1
0
mirror of https://github.com/moparisthebest/socat synced 2024-12-21 22:48:48 -05:00

corrections for OpenEmbedded, especially termios SHIFT values andISPEED/OSPEED

This commit is contained in:
Gerhard Rieger 2011-11-22 13:47:58 +01:00
parent 98abed1abd
commit d2fab02571
5 changed files with 19 additions and 5 deletions

View File

@ -78,6 +78,9 @@ porting:
fixed compiler warnings on Mac OS X 64bit. Thanks to Guy Harris for
providing the patch.
corrections for OpenEmbedded, especially termios SHIFT values and
ISPEED/OSPEED. Thanks to John Faith for providing the patch
####################### V 1.7.1.3:
security:

View File

@ -1325,10 +1325,13 @@ AC_CACHE_CHECK(shift offset of $1, $2,
],
[$2=`cat $conftestoffset`],
[$2=-1],
[AC_MSG_RESULT(please determine $1_SHIFT manually)]
[$2=-1]
)
LIBS="$LIBS1"])
AC_DEFINE_UNQUOTED($1_SHIFT, ${$2})
if test "$2" = -1; then
AC_MSG_WARN(please determine $1_SHIFT manually)
fi
])
AC_SHIFT_OFFSET(CRDLY, sc_cv_sys_crdly_shift)

View File

@ -1,5 +1,5 @@
/* source: xio-termios.c */
/* Copyright Gerhard Rieger 2001-2008 */
/* Copyright Gerhard Rieger 2001-2011 */
/* Published under the GNU General Public License V.2, see file COPYING */
/* this file contains the source for terminal I/O options */
@ -270,8 +270,12 @@ const struct optdesc opt_raw = { "raw", NULL, OPT_RAW, GROUP_TER
const struct optdesc opt_sane = { "sane", NULL, OPT_SANE, GROUP_TERMIOS, PH_FD, TYPE_CONST, OFUNC_TERMIOS_SPEC };
#ifdef HAVE_TERMIOS_ISPEED
#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
#if defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
const struct optdesc opt_ispeed = { "ispeed", NULL, OPT_ISPEED, GROUP_TERMIOS, PH_FD, TYPE_UINT, OFUNC_TERMIOS_SPEED, ISPEED_OFFSET };
const struct optdesc opt_ospeed = { "ospeed", NULL, OPT_OSPEED, GROUP_TERMIOS, PH_FD, TYPE_UINT, OFUNC_TERMIOS_SPEED, OSPEED_OFFSET };
#endif
#endif
#endif /* HAVE_TERMIOS_ISPEED */

View File

@ -62,11 +62,15 @@ int xioinitialize(void) {
assert(tdata.termarg.c_oflag == tdata.flags[1]);
assert(tdata.termarg.c_cflag == tdata.flags[2]);
assert(tdata.termarg.c_lflag == tdata.flags[3]);
#if HAVE_TERMIOS_ISPEED
#if HAVE_TERMIOS_ISPEED && (ISPEED_OFFSET != -1) && (OSPEED_OFFSET != -1)
#if defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
#if defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
tdata.termarg.c_ispeed = 0x56789abc;
tdata.termarg.c_ospeed = 0x6789abcd;
assert(tdata.termarg.c_ispeed == tdata.speeds[ISPEED_OFFSET]);
assert(tdata.termarg.c_ospeed == tdata.speeds[OSPEED_OFFSET]);
#endif
#endif
#endif
}
#endif

View File

@ -779,7 +779,7 @@ const struct optname optionnames[] = {
IF_IP6 ("ipv6only", &opt_ipv6_v6only)
#endif
IF_TERMIOS("isig", &opt_isig)
#ifdef HAVE_TERMIOS_ISPEED
#if defined(HAVE_TERMIOS_ISPEED) && defined(ISPEED_OFFSET) && (ISPEED_OFFSET != -1)
IF_TERMIOS("ispeed", &opt_ispeed)
#endif
IF_TERMIOS("istrip", &opt_istrip)
@ -1093,7 +1093,7 @@ const struct optname optionnames[] = {
IF_OPENSSL("openssl-pseudo", &opt_openssl_pseudo)
IF_OPENSSL("openssl-verify", &opt_openssl_verify)
IF_TERMIOS("opost", &opt_opost)
#ifdef HAVE_TERMIOS_ISPEED
#if defined(HAVE_TERMIOS_ISPEED) && defined(OSPEED_OFFSET) && (OSPEED_OFFSET != -1)
IF_TERMIOS("ospeed", &opt_ospeed)
#endif
IF_ANY ("owner", &opt_user)