diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2000-07-17 05:43:11 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2000-07-17 05:43:11 +0000 |
commit | ebc2f56ae53ded559e95f9c4d7e440694c666866 (patch) | |
tree | a7aa7a42bc948bffa9b78ac3f69c190f551fc730 | |
parent | 0d92e64117b541a2fabc2c3d9e41f5c9a93d3b0b (diff) |
Be more careful about return values from hzto.
-rw-r--r-- | sys/compat/linux/linux_misc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 03f07b4357a..8d9dad211a8 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.28 2000/06/26 16:21:27 art Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.29 2000/07/17 05:43:10 art Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /* @@ -785,6 +785,7 @@ linux_sys_alarm(p, v, retval) } */ *uap = v; int s; struct itimerval *itp, it; + int timo; itp = &p->p_realtimer; s = splclock(); @@ -825,8 +826,11 @@ linux_sys_alarm(p, v, retval) } if (timerisset(&it.it_value)) { + timo = hzto(&it.it_value); + if (timo < 0) + timo = 1; timeradd(&it.it_value, &time, &it.it_value); - timeout_add(&p->p_realit_to, hzto(&it.it_value)); + timeout_add(&p->p_realit_to, timo); } p->p_realtimer = it; splx(s); |