From 54b7447337f23516c8249065a459372b4fdd9326 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Mon, 15 Feb 2010 00:21:17 -0500 Subject: [PATCH] ustd: use modulo value for first_subbuf This prevented crash recovery when the buffer filled. --- ustd/lowlevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ustd/lowlevel.c b/ustd/lowlevel.c index d8d4cfa..6565749 100644 --- a/ustd/lowlevel.c +++ b/ustd/lowlevel.c @@ -91,7 +91,7 @@ void finish_consuming_dead_subbuffer(struct buffer_info *buf) } /* Iterate on subbuffers to recover. */ - for(i_subbuf=first_subbuf; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { + for(i_subbuf = first_subbuf % buf->n_subbufs; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { void *tmp; /* commit_seq is the offset in the buffer of the end of the last sequential commit. * Bytes beyond this limit cannot be recovered. This is a free-running counter. */ -- 2.34.1