diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-06-25 10:34:52 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2015-06-25 10:34:52 +0000 |
commit | e5ea6f29cc2fd1a9fb521df4b14d650c666b3593 (patch) | |
tree | 63117235d88d2b9e01dc8c6296912bc46f3f01fa | |
parent | 0087651633d498e1c94013c270620a10b659d8cd (diff) | |
download | lm-sensors-e5ea6f29cc2fd1a9fb521df4b14d650c666b3593.tar.gz |
fancontrol: Reduce memory consumption
Construct "wait $!" causes bash to remember the exit status of the
children. This consumes memory. We don't need the status code and we
are only waiting for a single child, so we can simply use "wait". This
will reduce the memory usage.
This partly fixes ticket #2391.
http://www.lm-sensors.org/ticket/2391
The actual leak is in bash 4.3 and should be fixed there.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@6291 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r-- | CHANGES | 1 | ||||
-rwxr-xr-x | prog/pwm/fancontrol | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -11,6 +11,7 @@ SVN HEAD sensors: Add support for temperature min and critical min hysteresis fancontrol: Deal with moving hwmon attributes Fix shell error when FCFANS is not set + Reduce memory consumption (#2391) healthd: Avoid using external commands sensors-detect: Add detection of ADC128D818 Add detection of AMD family 16h Kabini and Mullins diff --git a/prog/pwm/fancontrol b/prog/pwm/fancontrol index 85aa8bc9..9030438c 100755 --- a/prog/pwm/fancontrol +++ b/prog/pwm/fancontrol @@ -546,7 +546,7 @@ function UpdateFanSpeeds echo $minsa > $pwmo # Sleep while still handling signals sleep 1 & - wait $! + wait fi fi echo $pwmval > $pwmo # write new value to pwm output @@ -585,5 +585,5 @@ do UpdateFanSpeeds # Sleep while still handling signals sleep $INTERVAL & - wait $! + wait done |