util/disk_cache: don't fallback to an empty cache dir on evict
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 14 Mar 2017 00:22:44 +0000 (11:22 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Wed, 15 Mar 2017 00:15:11 +0000 (11:15 +1100)
commitc2793e2c890b828c6cb1e9694619255d69a2ca1e
tree8b9798db164df757bf60f9c7199c529be461e870
parent50989f87e62e0b9a4796c565a103ce45c684c673
util/disk_cache: don't fallback to an empty cache dir on evict

If we fail to randomly select a two letter cache dir, don't select
an empty dir on fallback.

In real world use we should never hit the fallback path but it can
be hit by tests when the cache is set to a very small max value.

Reviewed-by: Grazvydas Ignotas <notasas@gmail.com>
src/util/disk_cache.c