diff options
author | Jean Delvare <khali@linux-fr.org> | 2015-06-25 10:34:52 +0000 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2015-06-25 10:34:52 +0000 |
commit | 096a5fc953d78246884beba49363a9113d110365 (patch) | |
tree | 63117235d88d2b9e01dc8c6296912bc46f3f01fa | |
parent | 59df826a298846966e383a87e9903f93b967fbdb (diff) | |
download | lm-sensors-git-096a5fc953d78246884beba49363a9113d110365.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.
-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 |