Changeset 5f040b8 in rtems for cpukit/libblock


Ignore:
Timestamp:
Sep 5, 2013, 6:21:32 PM (6 years ago)
Author:
Gedare Bloom <gedare@…>
Branches:
4.11, master
Children:
59261fba
Parents:
97ae1eeb
Message:

sparse-disk: check return value from semaphore_obtain/release

In case obtain/release is unsuccessful, cause a fatal error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libblock/src/sparse-disk.c

    r97ae1eeb r5f040b8  
    237237  size_t                  buff_size;
    238238  unsigned int            bytes_handled;
    239 
    240   rtems_semaphore_obtain( sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
     239  rtems_status_code       sc;
     240
     241  sc = rtems_semaphore_obtain(sparse_disk->mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
     242  if (sc != RTEMS_SUCCESSFUL) {
     243      rtems_fatal_error_occurred( 0xdeadbeef );
     244  }
    241245
    242246  for ( req_buffer = 0;
     
    268272  }
    269273
    270   rtems_semaphore_release( sparse_disk->mutex );
     274  sc = rtems_semaphore_release( sparse_disk->mutex );
     275  if (sc != RTEMS_SUCCESSFUL) {
     276      rtems_fatal_error_occurred( 0xdeadbeef );
     277  }
    271278
    272279  if ( 0 > rv )
Note: See TracChangeset for help on using the changeset viewer.