Changeset 354064b in rtems


Ignore:
Timestamp:
Mar 7, 2016, 2:24:19 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
12c9dc8f
Parents:
9f5754b5
Message:

libtests/syscall01: Explicitly request close

This makes the test more reliable in case an interrupt driven console
driver is used.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/libtests/syscall01/init.c

    r9f5754b5 r354064b  
    9292    int rv;
    9393
     94    sc = rtems_event_transient_receive(RTEMS_WAIT, RTEMS_NO_TIMEOUT);
     95    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     96
    9497    rv = close(ctx->fd);
    9598    rtems_test_assert(rv == 0);
     
    100103}
    101104
     105static void request_close(test_context *ctx)
     106{
     107  rtems_status_code sc;
     108
     109  sc = rtems_event_transient_send(ctx->close_task);
     110  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     111}
     112
    102113static void wait_for_close_task(void)
    103114{
     
    120131  rv = listen(ctx->fd, 1);
    121132  rtems_test_assert(rv == 0);
     133
     134  request_close(ctx);
    122135
    123136  errno = 0;
     
    148161  addr.sin_addr.s_addr = htonl(INADDR_ANY);
    149162
     163  request_close(ctx);
     164
    150165  errno = 0;
    151166  rv = connect(ctx->fd, (struct sockaddr *) &addr, addrlen);
     
    180195  rtems_test_assert(rv == 0);
    181196
     197  request_close(ctx);
     198
    182199  errno = 0;
    183200  n = recv(ctx->fd, &buf[0], sizeof(buf), 0);
     
    215232  FD_ZERO(&set);
    216233  FD_SET(ctx->fd, &set);
     234
     235  request_close(ctx);
    217236
    218237  errno = 0;
Note: See TracChangeset for help on using the changeset viewer.