[rtems commit] termios: Fix tcflow() error status

Sebastian Huber sebh at rtems.org
Thu Dec 13 10:33:37 UTC 2012


Module:    rtems
Branch:    master
Commit:    ad13ebe071fa9ce99824ee7a88b396d27add79b9
Changeset: http://git.rtems.org/rtems/commit/?id=ad13ebe071fa9ce99824ee7a88b396d27add79b9

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Dec 12 09:36:02 2012 +0100

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 c445ffb..7de2e98 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 7659314..92e37ad 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" );




More information about the vc mailing list