diff options
Diffstat (limited to 'c/src/exec')
-rw-r--r-- | c/src/exec/posix/src/time.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/c/src/exec/posix/src/time.c b/c/src/exec/posix/src/time.c index cc501f464b..5e202111dd 100644 --- a/c/src/exec/posix/src/time.c +++ b/c/src/exec/posix/src/time.c @@ -247,6 +247,9 @@ int nanosleep( { Watchdog_Interval ticks; + if ( !rqtp ) + set_errno_and_return_minus_one( EINVAL ); + /* * Return EAGAIN if the delay interval is negative. * @@ -272,6 +275,10 @@ int nanosleep( if ( !ticks ) { _Thread_Yield_processor(); _Thread_Dispatch(); + if ( rmtp ) { + rmtp->tv_sec = 0; + rmtp->tv_nsec = 0; + } return 0; } |