]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
DW:
authorwessels <>
Tue, 11 Jan 2000 11:57:15 +0000 (11:57 +0000)
committerwessels <>
Tue, 11 Jan 2000 11:57:15 +0000 (11:57 +0000)
 - Fixed off-by-one bug in comparison when 'suggestion' exceeds
   fm->max_n_files.
 - Changed file_map_allocate so that it no longer sets the
   available bitmap before returning.  Now its the job of the
   other end to set the bitmap.  "allocate" is probably no longer
   a good descriptive name.

src/filemap.cc

index 0392d35cf6911c84d90c3f5db55ef2f1d8bd82e3..2e5e1963f742a8a240316b72d019d1b986e279e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: filemap.cc,v 1.32 1999/12/01 04:28:07 wessels Exp $
+ * $Id: filemap.cc,v 1.33 2000/01/11 04:57:15 wessels Exp $
  *
  * DEBUG: section 8     Swap File Bitmap
  * AUTHOR: Harvest Derived
@@ -120,11 +120,10 @@ file_map_allocate(fileMap * fm, int suggestion)
     int word;
     int bit;
     int count;
-    if (suggestion > fm->max_n_files)
+    if (suggestion >= fm->max_n_files)
        suggestion = 0;
-    if (!file_map_bit_test(fm, suggestion)) {
-       return file_map_bit_set(fm, suggestion);
-    }
+    if (!file_map_bit_test(fm, suggestion))
+       return suggestion;
     word = suggestion >> LONG_BIT_SHIFT;
     for (count = 0; count < fm->nwords; count++) {
        if (fm->file_map[word] != ALL_ONES)