diff options
author | Elliott Hughes <enh@google.com> | 2015-08-28 21:29:52 -0700 |
---|---|---|
committer | Tyler Dunn <robotdude@att.net> | 2016-02-02 20:53:46 -0500 |
commit | f6c4d2c1197020d4fc32e48a9893ed6697b700a7 (patch) | |
tree | a0c69fd1a91356af5ffab5fae67146fdc7ee2c7d | |
parent | a38d6f2b74d5953b3d7726415aef907eb3cde1f9 (diff) | |
download | android_external_dhcpcd-f6c4d2c1197020d4fc32e48a9893ed6697b700a7.tar.gz android_external_dhcpcd-f6c4d2c1197020d4fc32e48a9893ed6697b700a7.tar.bz2 android_external_dhcpcd-f6c4d2c1197020d4fc32e48a9893ed6697b700a7.zip |
Don't fork and exec ls when the shell can stat files.
I doubt this has any measurable impact, but there's no reason to be wasteful.
Change-Id: I94a153df9073ac5eea4c310e03b2d5f360791276
-rwxr-xr-x | dhcpcd-run-hooks | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dhcpcd-run-hooks b/dhcpcd-run-hooks index 8b68c69..a39a133 100755 --- a/dhcpcd-run-hooks +++ b/dhcpcd-run-hooks @@ -25,7 +25,7 @@ do */[0-9][0-9]"-${skip}.sh") continue 2;; esac done - if ls "${hook}" >/dev/null 2>&1; then + if [ -f "${hook}" ]; then . "${hook}" fi done |