aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-12-05 12:59:49 +0100
committerMattias Andrée <maandree@operamail.com>2015-12-05 12:59:56 +0100
commit7a5ae096e018fd91443a04c5a94ae83b268c8d31 (patch)
tree5fe8c01088210df6673999b5dc63658fc17fd249 /src
parentfix makefile (diff)
downloadpasscheck-7a5ae096e018fd91443a04c5a94ae83b268c8d31.tar.gz
passcheck-7a5ae096e018fd91443a04c5a94ae83b268c8d31.tar.bz2
passcheck-7a5ae096e018fd91443a04c5a94ae83b268c8d31.tar.xz
inform the kernel that the blacklist will be accessed in random order
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/passcheck4
1 files changed, 4 insertions, 0 deletions
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