Changeset 66bf2cc9 in rtems


Ignore:
Timestamp:
Dec 19, 2013, 12:54:53 AM (5 years ago)
Author:
Allan Hessenflow <allanh@…>
Branches:
4.11, master
Children:
7cf81ba
Parents:
2b03a62
git-author:
Allan Hessenflow <allanh@…> (12/19/13 00:54:53)
git-committer:
Gedare Bloom <gedare@…> (01/09/14 15:07:48)
Message:

mw_uid: corrects uid_read_message short timeouts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/fb/mw_uid.c

    r2b03a62 r66bf2cc9  
    9191  rtems_status_code status;
    9292  size_t            size = 0;
    93   unsigned long     micro_secs = timeout*1000;
    9493  int               wait = (timeout != 0);
     94  int ticks = RTEMS_MICROSECONDS_TO_TICKS(timeout * 1000);
     95
     96  if (timeout == (unsigned long) -1) {
     97    ticks = RTEMS_NO_TIMEOUT;
     98  } else if (timeout && ticks == 0) {
     99    /* if timeout greater than 0 and smaller than a tick, round up to avoid
     100     * unintentionally RTEMS_NO_TIMEOUT
     101     */
     102    ticks = 1;
     103  }
    95104
    96105  status = rtems_message_queue_receive(
     
    99108   &size,
    100109   wait ? RTEMS_WAIT : RTEMS_NO_WAIT,
    101    RTEMS_MICROSECONDS_TO_TICKS(micro_secs)
     110   ticks
    102111  );
    103112
Note: See TracChangeset for help on using the changeset viewer.