termios: Fix tcflow() error status

This commit is contained in:
Sebastian Huber
2012-12-12 09:36:02 +01:00
parent 8e3a7f4f8d
commit ad13ebe071
2 changed files with 13 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ int tcflow (
case TCOON:
case TCIOFF:
case TCION:
break;
default:
rtems_set_errno_and_return_minus_one( EINVAL );
}

View File

@@ -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" );