aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-08-28 21:29:52 -0700
committerElliott Hughes <enh@google.com>2015-08-28 21:29:52 -0700
commit1fc29fe3a470659b7c9cc0f2b34b63d0d3258835 (patch)
tree75a276721dce779d5aff09d0edee356de4debe3e
parenta975f64d97a5b41e0f4f9410d84d84eeb1aa6918 (diff)
downloaddhcpcd-1fc29fe3a470659b7c9cc0f2b34b63d0d3258835.tar.gz
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