Skip to contentSkip to conversation

OpenSM Ignore invalid command line option -t 0

PATCH Applied Tamir Ronen 2 participants 2 messages Mar 20, 2011 – Mar 21, 2011 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OpenSM Ignore invalid command line option -t 0

Quoted 2 lines

From acc805cdf65e12e2cee9bfbf360a176c55a5949f Mon Sep 17 00:00:00 2001

From: Tamir Ronen <tamirr-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu, 17 Mar 2011 15:21:43 +0200
Subject: [PATCH] Ignore command line option -t 0

If the timeout specified in the command line option -t equals zero, Print an error message and ignore it.

---
 opensm/main.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
opensm/main.c +10 -4
index 756fe6f..9d489f2 100644
@@ -249,7 +249,7 @@ static void show_usage(void)
 	printf("--timeout, -t <milliseconds>\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 <number>\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':
Signature · 6 lines
1.5.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Applied
#2 lore raw
In reply to a message not in the archive
Quoted 9 lines · Tamir Ronen

From acc805cdf65e12e2cee9bfbf360a176c55a5949f Mon Sep 17 00:00:00 2001
From: Tamir Ronen <tamirr-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Thu, 17 Mar 2011 15:21:43 +0200
Subject: [PATCH] Ignore command line option -t 0

If the timeout specified in the command line option -t equals zero, Print an error message and ignore it.
---

Applied. Thanks.

Also fixed description in the man/opensm.8.in
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html