Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern restore flags-as-bitmask, just in case another func...



details:   https://anonhg.NetBSD.org/src/rev/753d24ba129d
branches:  trunk
changeset: 960400:753d24ba129d
user:      nia <nia%NetBSD.org@localhost>
date:      Thu Mar 18 14:05:37 2021 +0000

description:
restore flags-as-bitmask, just in case another function is passing its
flags here.

diffstat:

 sys/kern/subr_time.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 9bf62c35481e -r 753d24ba129d sys/kern/subr_time.c
--- a/sys/kern/subr_time.c      Thu Mar 18 14:01:18 2021 +0000
+++ b/sys/kern/subr_time.c      Thu Mar 18 14:05:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_time.c,v 1.29 2021/03/18 14:01:18 nia Exp $       */
+/*     $NetBSD: subr_time.c,v 1.30 2021/03/18 14:05:37 nia Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.29 2021/03/18 14:01:18 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.30 2021/03/18 14:05:37 nia Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -332,7 +332,7 @@
        if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000L)
                return EINVAL;
 
-       if (flags == TIMER_ABSTIME || start != NULL) {
+       if ((flags & TIMER_ABSTIME) != 0 || start != NULL) {
                error = clock_gettime1(clock_id, &tsd);
                if (error != 0)
                        return error;
@@ -340,7 +340,7 @@
                        *start = tsd;
        }
 
-       if (flags == TIMER_ABSTIME) {
+       if ((flags & TIMER_ABSTIME) != 0) {
                if ((tsd.tv_sec > 0 && ts->tv_sec < LLONG_MIN + tsd.tv_sec) ||
                    (tsd.tv_sec < 0 && ts->tv_sec > LLONG_MAX + tsd.tv_sec))
                        return EINVAL;



Home | Main Index | Thread Index | Old Index