diff options
author | Kevin Locke | 2017-10-30 20:50:51 +0100 |
---|---|---|
committer | Kevin Locke | 2017-10-30 21:12:55 +0100 |
commit | d22c1f533275ebf7060d9aa6dffc3ef265e81176 (patch) | |
tree | 15d2c454b19878175fe8207e8ecc4a8f1b344fa2 /bash-completion | |
parent | dmesg: add note about -F format to the man page (diff) | |
download | kernel-qcow2-util-linux-d22c1f533275ebf7060d9aa6dffc3ef265e81176.tar.gz kernel-qcow2-util-linux-d22c1f533275ebf7060d9aa6dffc3ef265e81176.tar.xz kernel-qcow2-util-linux-d22c1f533275ebf7060d9aa6dffc3ef265e81176.zip |
bash-completion: Exclude /dev/fd from fsck find
When the bash-completion for fsck runs `find -L /dev/ -type b` it
descends into /dev/fd after opening '.' as file descriptor 3. This
causes find to search through /dev/fd/3/ which includes everything below
the current directory, which can take a very long time.
To avoid this, prune /dev/fd in the find expression.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Diffstat (limited to 'bash-completion')
-rw-r--r-- | bash-completion/fsck | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bash-completion/fsck b/bash-completion/fsck index 816422f52..e5b4f53b4 100644 --- a/bash-completion/fsck +++ b/bash-completion/fsck @@ -32,7 +32,8 @@ _fsck_module() return 0 ;; esac - COMPREPLY=( $(compgen -W "$(find -L /dev/ -type b 2>/dev/null)" -- $cur) ) + COMPREPLY=( $(compgen -W "$(find -L /dev/ -path /dev/fd -prune \ + -o -type b -print 2>/dev/null)" -- $cur) ) return 0 } complete -F _fsck_module fsck |