diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-10-08 18:57:39 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-10-08 18:57:39 +0000 |
commit | f70e1749eb82732c60393b91d501e39f2fecb6af (patch) | |
tree | a0908bfa17b58274915b34cb78becaf9a96ced5e | |
parent | ab69048b80bb89c78430b2db8f170a4af611c955 (diff) |
If the hotplug queue is full, bump the tail pointer in the circular buffer.
ok grange@
-rw-r--r-- | sys/dev/hotplug.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/hotplug.c b/sys/dev/hotplug.c index 73e45f87116..b463370010e 100644 --- a/sys/dev/hotplug.c +++ b/sys/dev/hotplug.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hotplug.c,v 1.5 2004/09/15 18:58:59 grange Exp $ */ +/* $OpenBSD: hotplug.c,v 1.6 2004/10/08 18:57:38 drahn Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -91,7 +91,10 @@ hotplug_put_event(struct hotplug_event *he) evqueue[evqueue_head] = *he; evqueue_head = EVQUEUE_NEXT(evqueue_head); - evqueue_count++; + if (evqueue_count == HOTPLUG_MAXEVENTS) + evqueue_tail = EVQUEUE_NEXT(evqueue_tail); + else + evqueue_count++; wakeup(&evqueue); selwakeup(&hotplug_sel); KNOTE(&hotplug_sel.si_note, 0); |