Changeset 36635433 in rtems
- Timestamp:
- 02/24/17 13:44:04 (7 years ago)
- Branches:
- 5, master
- Children:
- 902ffed
- Parents:
- a165a96
- git-author:
- Sebastian Huber <sebastian.huber@…> (02/24/17 13:44:04)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (02/28/17 08:09:23)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/libcsupport/src/termios.c
ra165a96 r36635433 1215 1215 1216 1216 static uint32_t 1217 rtems_termios_write_tty (rtems_termios_tty *tty, const char *buf, uint32_t len) 1218 { 1219 bool wait = true; 1217 rtems_termios_write_tty (rtems_libio_t *iop, rtems_termios_tty *tty, 1218 const char *buf, uint32_t len) 1219 { 1220 bool wait = ((iop->flags & LIBIO_FLAGS_NO_DELAY) == 0); 1220 1221 1221 1222 if (tty->termios.c_oflag & OPOST) { … … 1253 1254 return sc; 1254 1255 } 1255 args->bytes_moved = rtems_termios_write_tty (tty, args->buffer, args->count); 1256 args->bytes_moved = rtems_termios_write_tty (args->iop, tty, 1257 args->buffer, args->count); 1256 1258 rtems_semaphore_release (tty->osem); 1257 1259 return sc; … … 2163 2165 } 2164 2166 2165 bytes_moved = rtems_termios_write_tty ( tty, buffer, count);2167 bytes_moved = rtems_termios_write_tty (iop, tty, buffer, count); 2166 2168 rtems_semaphore_release (tty->osem); 2167 2169 return (ssize_t) bytes_moved; -
testsuites/libtests/termios09/init.c
ra165a96 r36635433 200 200 } 201 201 202 static void enable_non_blocking(test_context *ctx, size_t i, bool enable) 203 { 204 int flags; 205 int rv; 206 207 flags = fcntl(ctx->fds[i], F_GETFL, 0); 208 rtems_test_assert(flags >= 0); 209 210 if (enable) { 211 flags |= O_NONBLOCK; 212 } else { 213 flags &= ~O_NONBLOCK; 214 } 215 216 rv = fcntl(ctx->fds[i], F_SETFL, flags); 217 rtems_test_assert(rv == 0); 218 } 219 202 220 static void clear_set_iflag( 203 221 test_context *ctx, … … 969 987 rtems_test_assert(ctx->context_switch_counter == 0); 970 988 989 enable_non_blocking(ctx, i, true); 990 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 1], 1); 991 rtems_test_assert(n == 0); 992 993 enable_non_blocking(ctx, i, false); 971 994 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 1], 1); 972 995 rtems_test_assert(n == 1); … … 995 1018 rtems_test_assert(ctx->context_switch_counter == 2); 996 1019 1020 enable_non_blocking(ctx, i, true); 1021 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 2], 1); 1022 rtems_test_assert(n == 0); 1023 1024 enable_non_blocking(ctx, i, false); 997 1025 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 2], 1); 998 1026 rtems_test_assert(n == 1); … … 1021 1049 rtems_test_assert(ctx->context_switch_counter == 4); 1022 1050 1051 enable_non_blocking(ctx, i, true); 1052 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 8], 1); 1053 rtems_test_assert(n == 0); 1054 1055 enable_non_blocking(ctx, i, false); 1023 1056 n = write(ctx->fds[i], &buf[OUTPUT_BUFFER_SIZE - 8], 1); 1024 1057 rtems_test_assert(n == 1);
Note: See TracChangeset
for help on using the changeset viewer.