setitimer() allows the second argument to be NULL.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19411 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-12-01 13:08:24 +00:00
parent d081f61f0c
commit 489caaef82

View File

@ -41,9 +41,11 @@ setitimer(int which, const struct itimerval *value, struct itimerval *oldValue)
}
}
// Record the time left of any previous itimer
oldValue->it_value.tv_sec = remaining / USEC_PER_SECOND;
oldValue->it_value.tv_usec = remaining % USEC_PER_SECOND;
if (oldValue != NULL) {
// Record the time left of any previous itimer
oldValue->it_value.tv_sec = remaining / USEC_PER_SECOND;
oldValue->it_value.tv_usec = remaining % USEC_PER_SECOND;
}
return 0;
}