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:
parent
6c73457c09
commit
9db12bbaff
1 changed files with 1 additions and 1 deletions
|
@ -100,7 +100,7 @@ process_qdisc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# while not orphaned
|
# 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
|
for ifc in "$@" ; do
|
||||||
process_qdisc "$ifc"
|
process_qdisc "$ifc"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue