diff options
| author | Mattias Andrée <maandree@operamail.com> | 2015-12-05 12:59:49 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2015-12-05 12:59:56 +0100 |
| commit | 7a5ae096e018fd91443a04c5a94ae83b268c8d31 (patch) | |
| tree | 5fe8c01088210df6673999b5dc63658fc17fd249 /src | |
| parent | fix makefile (diff) | |
| download | passcheck-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-x | src/passcheck | 4 |
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 |
