if you want to return something at least be consistent with the version of usleep which returns an int... (return -1 and set errno)
see http://www.die.net/doc/linux/man/man3/usleep.3.html git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11510 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
feeee8dff5
commit
b1bfc5c69f
@ -5,10 +5,16 @@
|
|||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <syscalls.h>
|
#include <syscalls.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
usleep(unsigned useconds)
|
usleep(unsigned useconds)
|
||||||
{
|
{
|
||||||
return snooze_until(system_time() + (bigtime_t)(useconds), B_SYSTEM_TIMEBASE);
|
int err;
|
||||||
|
err = snooze_until(system_time() + (bigtime_t)(useconds), B_SYSTEM_TIMEBASE);
|
||||||
|
if (err < 0) {
|
||||||
|
errno = err;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user