]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
cbq: fix find syntax in example
authorPavel Šimerda <psimerda@redhat.com>
Mon, 13 Apr 2015 14:00:58 +0000 (16:00 +0200)
committerStephen Hemminger <shemming@brocade.com>
Mon, 20 Apr 2015 16:57:14 +0000 (09:57 -0700)
Without modification, using the example resulted in the following error:

[root@localhost sbin]# cbq restart
find: warning: you have specified the -maxdepth option after a
non-option argument (, but options are not positional (-maxdepth affects
tests specified before it as well as those specified after it).  Please
specify options before other arguments.

find: warning: you have specified the -maxdepth option after a
non-option argument (, but options are not positional (-maxdepth affects
tests specified before it as well as those specified after it).  Please
specify options before other arguments.

**CBQ: failed to compile CBQ configuration!

See also:

 * https://bugzilla.redhat.com/show_bug.cgi?id=539232

Reported-by: Mads Kiilerich <mads@kiilerich.com>
Signed-off-by: Pavel Šimerda <psimerda@redhat.com>
examples/cbq.init-v0.7.3

index 35a0a05ea18f36860ea5b02e4134b46ca27a5999..1bc0d446f89838c4bb78f7cf3916c83903d4ca97 100644 (file)
@@ -578,14 +578,14 @@ cbq_show () {
 ### Check configuration and load DEVICES, DEVFIELDS and CLASSLIST from $1
 cbq_init () {
        ### Get a list of configured classes
-       CLASSLIST=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
-               -not -name '*~' -maxdepth 1 -printf "%f\n"| sort`
+       CLASSLIST=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
+               -not -name '*~' -printf "%f\n"| sort`
        [ -z "$CLASSLIST" ] &&
                cbq_failure "no configuration files found in $1!"
 
        ### Gather all DEVICE fields from $1/cbq-*
-       DEVFIELDS=`find $1 \( -type f -or -type l \) -name 'cbq-*' \
-                 -not -name '*~' -maxdepth 1| xargs sed -n 's/#.*//; \
+       DEVFIELDS=`find $1 -maxdepth 1 \( -type f -or -type l \) -name 'cbq-*' \
+                 -not -name '*~' | xargs sed -n 's/#.*//; \
                  s/[[:space:]]//g; /^DEVICE=[^,]*,[^,]*\(,[^,]*\)\?/ \
                  { s/.*=//; p; }'| sort -u`
        [ -z "$DEVFIELDS" ] &&