From ad13ebe071fa9ce99824ee7a88b396d27add79b9 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 12 Dec 2012 09:36:02 +0100 Subject: termios: Fix tcflow() error status --- cpukit/libcsupport/src/tcflow.c | 1 + testsuites/libtests/termios02/init.c | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/cpukit/libcsupport/src/tcflow.c b/cpukit/libcsupport/src/tcflow.c index c445ffb04f..7de2e98cdf 100644 --- a/cpukit/libcsupport/src/tcflow.c +++ b/cpukit/libcsupport/src/tcflow.c @@ -34,6 +34,7 @@ int tcflow ( case TCOON: case TCIOFF: case TCION: + break; default: rtems_set_errno_and_return_minus_one( EINVAL ); } diff --git a/testsuites/libtests/termios02/init.c b/testsuites/libtests/termios02/init.c index 7659314960..92e37add1c 100644 --- a/testsuites/libtests/termios02/init.c +++ b/testsuites/libtests/termios02/init.c @@ -47,35 +47,40 @@ rtems_task Init( tcdrain(2); rtems_test_assert( !sc ); - puts( "" ); + puts( "" ); /***** TEST TCFLOW *****/ puts( "tcflow(stdin, TCOOFF) - ENOTSUP" ); + errno = 0; sc = tcflow( 0, TCOOFF ); rtems_test_assert( sc == -1 ); - rtems_test_assert( errno = ENOTSUP ); + rtems_test_assert( errno == ENOTSUP ); puts( "tcflow(stdin, TCOON) - ENOTSUP" ); + errno = 0; sc = tcflow( 0, TCOON ); rtems_test_assert( sc == -1 ); - rtems_test_assert( errno = ENOTSUP ); + rtems_test_assert( errno == ENOTSUP ); puts( "tcflow(stdin, TCIOFF) - ENOTSUP" ); + errno = 0; sc = tcflow( 0, TCIOFF ); rtems_test_assert( sc == -1 ); - rtems_test_assert( errno = ENOTSUP ); + rtems_test_assert( errno == ENOTSUP ); puts( "tcflow(stdin, TCION) - ENOTSUP" ); + errno = 0; sc = tcflow( 0, TCION ); rtems_test_assert( sc == -1 ); - rtems_test_assert( errno = ENOTSUP ); + rtems_test_assert( errno == ENOTSUP ); puts( "tcflow(stdin, 22) - EINVAL" ); + errno = 0; sc = tcflow( 0, 22 ); rtems_test_assert( sc == -1 ); - rtems_test_assert( errno = EINVAL ); + rtems_test_assert( errno == EINVAL ); - puts( "" ); + puts( "" ); /***** TEST TCFLUSH *****/ puts( "tcflush(stdin, TCIFLUSH) - ENOTSUP" ); -- cgit v1.2.3