From 7a5ae096e018fd91443a04c5a94ae83b268c8d31 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 5 Dec 2015 12:59:49 +0100 Subject: inform the kernel that the blacklist will be accessed in random order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/passcheck | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/passcheck b/src/passcheck index ab3f323..0633e40 100755 --- a/src/passcheck +++ b/src/passcheck @@ -208,6 +208,10 @@ if waste_ram: else: blacklist = set([]) fd = os.open('blacklist', os.O_RDONLY) + try: + os.posix_fadvise(fd, 0, 0, os.POSIX_FADV_RANDOM) + except: + pass blacklist_files.append((fd, os.fstat(fd).st_size)) for directory in ['/usr/share/dict/', '/usr/local/share/dict/']: dictionaries = None -- cgit v1.2.3-70-g09d2