sleep() was returning remaining nanoseconds (kind of), instead the remaining seconds.

This commit is contained in:
Eunbong Song 2016-11-15 06:47:59 -06:00 committed by Gregory Nutt
parent 5dfc5f1da5
commit 4545af3249
1 changed files with 1 additions and 21 deletions

View File

@ -45,26 +45,6 @@
#include <nuttx/clock.h>
#include <arch/irq.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Private Type Definitions
****************************************************************************/
/****************************************************************************
* Public Data
****************************************************************************/
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Function Prototypes
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@ -150,7 +130,7 @@ unsigned int sleep(unsigned int seconds)
if (ret < 0)
{
remaining = rmtp.tv_nsec;
remaining = rmtp.tv_sec;
if (remaining < seconds && rmtp.tv_nsec >= 500000000)
{
/* Round up */