aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-08-28 21:29:52 -0700
committerTyler Dunn <robotdude@att.net>2016-02-02 20:53:46 -0500
commitf6c4d2c1197020d4fc32e48a9893ed6697b700a7 (patch)
treea0c69fd1a91356af5ffab5fae67146fdc7ee2c7d
parenta38d6f2b74d5953b3d7726415aef907eb3cde1f9 (diff)
downloadandroid_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-xdhcpcd-run-hooks2
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