Commit 21e487f2 introduced the use of getopt, but getopt will fail when
it sees arguments meant for netstat that are not in [short|long]options.
There should not be any ambiguity about arguments with the same letter:
those to the left of the -- are destined for lxc-netstat and those to
the right for the real netstat, which the original code handles by
shifting out all arguments it recognizes before the -- is hit.

Signed-off-by: Dwight Engen <dwight.en...@oracle.com>
---
 src/lxc/lxc-netstat.in |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/src/lxc/lxc-netstat.in b/src/lxc/lxc-netstat.in
index 367568c..4abe25f 100644
--- a/src/lxc/lxc-netstat.in
+++ b/src/lxc/lxc-netstat.in
@@ -67,19 +67,8 @@ get_parent_cgroup()
        done
 }
 
-shortoptions='hn:'
-longoptions='help,name:,exec'
-
-getopt=$(getopt -o $shortoptions --longoptions  $longoptions -- "$@")
-if [ $? != 0 ]; then
-    usage
-    exit 1;
-fi
-
 exec=""
 
-eval set -- "$getopt"
-
 while true; do
        case $1 in
                -h|--help)
@@ -91,7 +80,7 @@ while true; do
                --)
                        shift; break;;
                *)
-                       break;
+                       break;;
        esac
 done
 
-- 
1.7.1


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to