Reverted r22484. setitimer() already sets errno, if necessary.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22487 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-10-08 19:58:54 +00:00
parent 873f2ffc1a
commit b510c4d236

View File

@ -15,17 +15,12 @@ uint
alarm(unsigned int sec)
{
struct itimerval value, oldValue;
int result;
value.it_interval.tv_sec = value.it_interval.tv_usec = 0;
value.it_value.tv_sec = sec;
value.it_value.tv_usec = 0;
result = setitimer(ITIMER_REAL, &value, &oldValue);
if (result < 0) {
errno = result;
if (setitimer(ITIMER_REAL, &value, &oldValue) < 0)
return -1;
}
if (oldValue.it_value.tv_usec)
oldValue.it_value.tv_sec++;