mirror of
https://github.com/openwrt/packages.git
synced 2026-12-04 22:05:48 +04:00
collectd: sqm_collect: optimise parent search
There can be only 1 parent process ID, so as soon as we find it, print it and exit - there's no point searching any of the following lines Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
This commit is contained in:
1 parent
6c73457c09
commit
9db12bbaff
1 file changed
+1
-1
@@ -100,7 +100,7 @@ process_qdisc() {
|
||||
}
|
||||
|
||||
# while not orphaned
|
||||
while [ $(awk '$1 ~ "^PPid:" {print $2}' /proc/$$/status) -ne 1 ] ; do
|
||||
while [ $(awk '$1 ~ "^PPid:" {print $2;exit}' /proc/$$/status) -ne 1 ] ; do
|
||||
for ifc in "$@" ; do
|
||||
process_qdisc "$ifc"
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user