Reset ring pointers when the ring empties out.
authorGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Wed, 28 Oct 1987 07:58:45 +0000 (23:58 -0800)
committerGregory Minshall <minshall@ucbvax.Berkeley.EDU>
Wed, 28 Oct 1987 07:58:45 +0000 (23:58 -0800)
SCCS-vsn: usr.bin/telnet/ring.c 1.5

usr/src/usr.bin/telnet/ring.c

index 389ce86..a738708 100644 (file)
@@ -95,6 +95,12 @@ int count;
 {
     ring->consume = ring_increment(ring, ring->consume, count);
     ring->consumetime = ++ring_clock;
 {
     ring->consume = ring_increment(ring, ring->consume, count);
     ring->consumetime = ++ring_clock;
+    /*
+     * Try to encourage "ring_empty_consecutive()" to be large.
+     */
+    if (ring_empty(ring)) {
+       ring->consume = ring->supply = ring->bottom;
+    }
 }
 
 
 }