corrections for OpenEmbedded, especially termios SHIFT values andISPEED/OSPEED

This commit is contained in:
Gerhard Rieger 2012-07-22 23:38:02 +02:00
parent a65b1c7c72
commit 799a6ba377
5 changed files with 30 additions and 16 deletions

View file

@ -126,6 +126,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 2.0.0-b7:
security:

View file

@ -1341,10 +1341,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-2012 */
/* 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

@ -68,11 +68,15 @@ int xioinitialize(int xioflags) {
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 /* WITH_TERMIOS */

View file

@ -786,7 +786,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)
@ -1057,7 +1057,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)