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:
François Revol 2005-02-28 11:41:39 +00:00
parent feeee8dff5
commit b1bfc5c69f

View File

@ -5,10 +5,16 @@
#include <unistd.h>
#include <syscalls.h>
#include <errno.h>
int
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;
}