From 489caaef82fcb3a8957ee8a99d8abe183c71bd0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 1 Dec 2006 13:08:24 +0000 Subject: [PATCH] setitimer() allows the second argument to be NULL. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19411 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/sys/itimer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/system/libroot/posix/sys/itimer.c b/src/system/libroot/posix/sys/itimer.c index be4144e026..14d8c576dd 100644 --- a/src/system/libroot/posix/sys/itimer.c +++ b/src/system/libroot/posix/sys/itimer.c @@ -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; }