Module Name: src Committed By: nia Date: Thu Mar 18 13:45:15 UTC 2021
Modified Files: src/sys/kern: subr_time.c Log Message: revert previous To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/kern/subr_time.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/subr_time.c diff -u src/sys/kern/subr_time.c:1.27 src/sys/kern/subr_time.c:1.28 --- src/sys/kern/subr_time.c:1.27 Thu Mar 18 12:37:51 2021 +++ src/sys/kern/subr_time.c Thu Mar 18 13:45:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_time.c,v 1.27 2021/03/18 12:37:51 nia Exp $ */ +/* $NetBSD: subr_time.c,v 1.28 2021/03/18 13:45:15 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.27 2021/03/18 12:37:51 nia Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_time.c,v 1.28 2021/03/18 13:45:15 nia Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -327,11 +327,15 @@ ts2timo(clockid_t clock_id, int flags, s int *timo, struct timespec *start) { int error; + struct timespec tsd; if (ts->tv_nsec < 0 || ts->tv_nsec >= 1000000000L) return EINVAL; - if (flags != TIMER_RELTIME || start != NULL) { + if (start == NULL) + start = &tsd; + + if (flags != TIMER_RELTIME || start != &tsd) { error = clock_gettime1(clock_id, start); if (error != 0) return error;