From patchwork Sun Mar 20 07:16:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamir Ronen X-Patchwork-Id: 646381 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2K7GISJ006497 for ; Sun, 20 Mar 2011 07:16:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751402Ab1CTHQS (ORCPT ); Sun, 20 Mar 2011 03:16:18 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:35781 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370Ab1CTHQR (ORCPT ); Sun, 20 Mar 2011 03:16:17 -0400 Received: by fxm17 with SMTP id 17so4730756fxm.19 for ; Sun, 20 Mar 2011 00:16:13 -0700 (PDT) Received: by 10.223.29.4 with SMTP id o4mr3364813fac.27.1300605373583; Sun, 20 Mar 2011 00:16:13 -0700 (PDT) Received: from [172.30.12.12] (fwil.voltaire.com [193.47.165.2]) by mx.google.com with ESMTPS id n7sm1974719fam.35.2011.03.20.00.16.11 (version=SSLv3 cipher=OTHER); Sun, 20 Mar 2011 00:16:12 -0700 (PDT) Message-ID: <4D85A9B3.3080601@dev.mellanox.co.il> Date: Sun, 20 Mar 2011 09:16:03 +0200 From: Tamir Ronen User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: alexne@mellanox.com CC: linux-rdma@vger.kernel.org Subject: [PATCH] OpenSM Ignore invalid command line option -t 0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 20 Mar 2011 07:16:19 +0000 (UTC) diff --git a/opensm/main.c b/opensm/main.c index 756fe6f..9d489f2 100644 --- a/opensm/main.c +++ b/opensm/main.c @@ -249,7 +249,7 @@ static void show_usage(void) printf("--timeout, -t \n" " This option specifies the time in milliseconds\n" " used for transaction timeouts.\n" - " Specifying -t 0 disables timeouts.\n" + " Specifying -t 0 is invalid.\n" " Without -t, OpenSM defaults to a timeout value of\n" " 200 milliseconds.\n\n"); printf("--retries \n" @@ -746,9 +746,15 @@ int main(int argc, char *argv[]) break; case 't': - opt.transaction_timeout = strtoul(optarg, NULL, 0); - printf(" Transaction timeout = %u\n", - opt.transaction_timeout); + val = strtoul(optarg, NULL, 0); + if(val == 0) + fprintf(stderr, + "ERROR: timeout value 0 is invalid. Ignoring it.\n"); + else { + opt.transaction_timeout = val; + printf(" Transaction timeout = %u\n", + opt.transaction_timeout); + } break; case 'n':