Changeset 7fbef786 in rtems for cpukit/posix/src/mqueueunlink.c


Ignore:
Timestamp:
12/23/99 22:09:36 (23 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
afebb3f
Parents:
8f12d069
Message:

+ Debugged.

File:
1 edited

Legend:

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

    r8f12d069 r7fbef786  
    4343  Objects_Locations                 location;
    4444 
     45  _Thread_Disable_dispatch();
     46
    4547  status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id );
    46    if ( status != 0 )
     48   if ( status != 0 ) {
     49    _Thread_Enable_dispatch();
    4750    set_errno_and_return_minus_one( status );
     51   }
     52
     53  /*
     54   *  Don't support unlinking a remote message queue.
     55   */
     56
     57  if ( !_Objects_Is_local_id(the_mq_id) ) {
     58    _Thread_Enable_dispatch();
     59    set_errno_and_return_minus_one( ENOSYS );
     60  }
     61
     62  the_mq = (POSIX_Message_queue_Control *) _Objects_Get_local_object(
     63    &_POSIX_Message_queue_Information,
     64    _Objects_Get_index( the_mq_id )
     65  );
     66 
     67#if defined(RTEMS_MULTIPROCESSING)
     68  if ( the_mq->process_shared == PTHREAD_PROCESS_SHARED ) {
     69    _Objects_MP_Close( &_POSIX_Message_queue_Information, the_mq_id );
     70  }
     71#endif
     72
    4873 
    49   the_mq = _POSIX_Message_queue_Get( the_mq_id, &location );
    50   switch ( location ) {
    51     case OBJECTS_ERROR:
    52       set_errno_and_return_minus_one( EINVAL );
    53     case OBJECTS_REMOTE:
    54       _Thread_Dispatch();
    55       return POSIX_MP_NOT_IMPLEMENTED();
    56       set_errno_and_return_minus_one( EINVAL );
    57     case OBJECTS_LOCAL:
    58  
    59 #if defined(RTEMS_MULTIPROCESSING)
    60       _Objects_MP_Close(
    61         &_POSIX_Message_queue_Information,
    62         the_mq->Object.id
    63       );
    64 #endif
    65  
    66       the_mq->linked = FALSE;
    67  
    68       _POSIX_Message_queue_Delete( the_mq );
    69  
    70       _Thread_Enable_dispatch();
    71       return 0;
    72   }
    73   return POSIX_BOTTOM_REACHED();
     74  the_mq->linked = FALSE;
     75  _POSIX_Message_queue_Namespace_remove( the_mq );
     76  _POSIX_Message_queue_Delete( the_mq );
     77
     78  _Thread_Enable_dispatch();
     79  return 0;
    7480}
    7581
Note: See TracChangeset for help on using the changeset viewer.