Changeset 3b3d1489 in rtems


Ignore:
Timestamp:
Sep 1, 2015, 12:16:48 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
8c25e04
Parents:
d9d0a84
git-author:
Sebastian Huber <sebastian.huber@…> (09/01/15 12:16:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/02/15 12:05:02)
Message:

posix: glibc compatibility

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/setcancelstate.c

    rd9d0a84 r3b3d1489  
    5151    return EPROTO;
    5252
    53   if ( !oldstate )
    54     return EINVAL;
    55 
    5653  if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE )
    5754    return EINVAL;
     
    6259    thread_support =  executing ->API_Extensions[ THREAD_API_POSIX ];
    6360
    64     *oldstate = thread_support->cancelability_state;
     61    if (oldstate != NULL)
     62      *oldstate = thread_support->cancelability_state;
     63
    6564    thread_support->cancelability_state = state;
    6665
  • cpukit/posix/src/setcanceltype.c

    rd9d0a84 r3b3d1489  
    5151    return EPROTO;
    5252
    53   if ( !oldtype )
    54     return EINVAL;
    55 
    5653  if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS )
    5754    return EINVAL;
     
    6259    thread_support =  executing ->API_Extensions[ THREAD_API_POSIX ];
    6360
    64     *oldtype = thread_support->cancelability_type;
     61    if ( oldtype != NULL )
     62      *oldtype = thread_support->cancelability_type;
     63
    6564    thread_support->cancelability_type = type;
    6665
  • testsuites/psxtests/psxcancel/init.c

    rd9d0a84 r3b3d1489  
    9696
    9797  /* generate some error conditions */
    98   puts( "Init - pthread_setcancelstate - NULL oldstate - EINVAL" );
     98  puts( "Init - pthread_setcancelstate - NULL oldstate" );
    9999  sc = pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
    100   fatal_posix_service_status( sc, EINVAL, "cancel state EINVAL" );
     100  fatal_posix_service_status( sc, 0, "cancel state NULL" );
    101101
    102102  puts( "Init - pthread_setcancelstate - bad state - EINVAL" );
     
    104104  fatal_posix_service_status( sc, EINVAL, "cancel state EINVAL" );
    105105
    106   puts( "Init - pthread_setcanceltype - NULL oldtype - EINVAL" );
     106  puts( "Init - pthread_setcanceltype - NULL oldtype" );
    107107  sc = pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
    108   fatal_posix_service_status( sc, EINVAL, "cancel type EINVAL" );
     108  fatal_posix_service_status( sc, 0, "cancel type NULL" );
    109109
    110110  puts( "Init - pthread_setcanceltype - bad type - EINVAL" );
  • testsuites/psxtests/psxcancel/psxcancel.scn

    rd9d0a84 r3b3d1489  
    1 *** POSIX CANCEL TEST ***
    2 Init - pthread_setcancelstate - NULL oldstate - EINVAL
     1*** BEGIN OF TEST PSXCANCEL ***
     2Init - pthread_setcancelstate - NULL oldstate
    33Init - pthread_setcancelstate - bad state - EINVAL
    4 Init - pthread_setcanceltype - NULL oldtype - EINVAL
     4Init - pthread_setcanceltype - NULL oldtype
    55Init - pthread_setcanceltype - bad type - EINVAL
    66Init - pthread_cancel - bad ID - EINVAL
Note: See TracChangeset for help on using the changeset viewer.