From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id AF36F8F9B for ; Wed, 4 Nov 2015 23:22:46 +0100 (CET) Received: by wicll6 with SMTP id ll6so99197239wic.0 for ; Wed, 04 Nov 2015 14:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding :content-type; bh=s7nstDrYOn8msRFMPkgVDh6RnMmTVCIhLCO+sBABpC4=; b=tFmuvZ1fT+L70t7XKOZoV3ZnG3BBJjrVLesJAlLHVBWOVR+bF+srxjBrXT0EfRHD1C qqJBr5LaIrcAPnel9lgRASfctdSvrQnnXUalbYlFSu9FudkpoSqBtQ9MhvLDF8AG4rdo MaW5Wy4szMmyuQCr7SfDyyLjTqxFHr893rJ8800kFS4apppvh+DQE/TQA/iH9AN2YsCd TvuVO9pDERvMCh8sSQwAbOR36qpPuXUQTBPrVk9oFesuFbvzPhP0MXRrzBUCrg/Hz5VP KqOLO+88jS9MaaJ4R+q6jeocMlEssXn+z/txlY9XSaH7vFWjvwuSs9gtRJT+RoP7oDFd 1Ihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=s7nstDrYOn8msRFMPkgVDh6RnMmTVCIhLCO+sBABpC4=; b=GT9tFRG1fxZeP0n+V0Xn9aySYfrkgv8GcrP+DZ70z23rFlTTBlJekAJG2/o+j0Bsdr c1z0uyunMnFnO9Uzp7fXQewH/ng3THsau6J6hzikk+b5+sgZTggsk1HkuXHQsHceaTO/ 2huIsn24aTtyBGil4JXBx/qsuFr1XfeKyq1LJnwE6YrYqkK8+pdQX24marFh6y7h+MP1 WaG8Nh6YjdQ3eofHvjtbxGh8codgUDsk5BWUWQlgYuWQnJe/LV7ESgsHfhc6+tbyApQ+ /Lp14xMnzP8C6DmOGj4/odJuY4FSaSdOpMfm9/++iGeDVmwojdZnxkEdU+/A8qGYM4CT 1CyQ== X-Gm-Message-State: ALoCoQkBWG9Qy7nRTva20WQ3YuHVJD+gbSQRS6yS/rQtVr4hg+vSBgqPIuM4spge7aaA1jxjEyeq X-Received: by 10.194.219.169 with SMTP id pp9mr5035580wjc.119.1446675766526; Wed, 04 Nov 2015 14:22:46 -0800 (PST) Received: from xps13.localnet ([93.158.51.175]) by smtp.gmail.com with ESMTPSA id ju5sm3733517wjc.1.2015.11.04.14.22.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Nov 2015 14:22:45 -0800 (PST) From: Thomas Monjalon To: Tiwei Bie Date: Wed, 04 Nov 2015 23:21:03 +0100 Message-ID: <7181004.z2BJ7V5WGs@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1444909564-53691-1-git-send-email-btw@mail.ustc.edu.cn> <20151019131617.GB13556@bricha3-MOBL3> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, dprovan@bivio.net Subject: Re: [dpdk-dev] [PATCH v2] eal: don't reset getopt lib X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2015 22:22:46 -0000 > > > Someone may need to call rte_eal_init() with a fake argc/argv array > > > in the middle of using getopt() to parse its own unrelated argc/argv > > > parameters. So getopt lib shouldn't be reset by rte_eal_init(). > > > > > > Now eal will always save optind, optarg and optopt (and optreset on > > > FreeBSD) at the beginning, initialize optind (and optreset on FreeBSD) > > > to 1 before calling getopt_long(), then restore all values after. > > > > > > Suggested-by: Don Provan > > > Suggested-by: Bruce Richardson > > > Signed-off-by: Tiwei Bie > > > Reviewed-by: Don Provan > > > Reviewed-by: Bruce Richardson > > > > Acked-by: Bruce Richardson > > Acked-by: David Marchand Applied, thanks