diff options
author | 2012-07-04 10:44:04 -0500 | |
---|---|---|
committer | 2012-07-04 10:44:04 -0500 | |
commit | 2967225819acc43adb3cbb62d558183e5f5a022e (patch) | |
tree | 1ca48643ae11bb2f91589abd05e2847074ce156a | |
parent | udev-mount: remove selinux code (diff) | |
download | udev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.tar.gz udev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.tar.bz2 udev-gentoo-scripts-2967225819acc43adb3cbb62d558183e5f5a022e.zip |
add caching to get_rundir
The get_rundir function should only run udevadm the first time it is
called.
-rw-r--r-- | init.d/udev | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/init.d/udev b/init.d/udev index 9eb74bd..365f78a 100644 --- a/init.d/udev +++ b/init.d/udev @@ -67,9 +67,14 @@ check_kernel() return 0 } +_RC_GET_RUNDIR_CACHE= get_rundir() { - echo $(udevadm info --run) + if [ -z "$_RC_GET_RUNDIR_CACHE" ]; then + _RC_GET_RUNDIR_CACHE="$(udevadm info --run)" + fi + echo "$_RC_GET_RUNDIR_CACHE" + return 0 } cleanup() |