summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-23 13:45:55 +0000
committerphk <phk@FreeBSD.org>2003-02-23 13:45:55 +0000
commit699d720e809af2bd7cc24abd1afc6990328905c5 (patch)
tree85cb3f545637e48f4f497578e0b9e56c404c9bfc /sys/kern/kern_time.c
parentd3b652a668f471022be55a1273b5c6aec40647a5 (diff)
downloadFreeBSD-src-699d720e809af2bd7cc24abd1afc6990328905c5.zip
FreeBSD-src-699d720e809af2bd7cc24abd1afc6990328905c5.tar.gz
OK, I was too sleepy there...
Pointy hat over here!
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 7dfa098..9cca995 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -159,10 +159,12 @@ clock_gettime(struct thread *td, struct clock_gettime_args *uap)
{
struct timespec ats;
- if (uap->clock_id != CLOCK_REALTIME)
+ if (uap->clock_id == CLOCK_REALTIME)
nanotime(&ats);
- else if (uap->clock_id != CLOCK_MONOTONIC)
+ else if (uap->clock_id == CLOCK_MONOTONIC)
nanouptime(&ats);
+ else
+ return (EINVAL);
return (copyout(&ats, uap->tp, sizeof(ats)));
}
OpenPOWER on IntegriCloud