]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[opensm] Better handle bad command line parameters.
authorTzachi Dar <tzachid@mellanox.co.il>
Wed, 25 Aug 2010 11:12:54 +0000 (11:12 +0000)
committerTzachi Dar <tzachid@mellanox.co.il>
Wed, 25 Aug 2010 11:12:54 +0000 (11:12 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@2872 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/ulp/opensm/user/opensm/main.c

index 6512b3eb4e35ab5dba7b11944781353bee1608c1..c073cc8c36fcd171a541137f3515673d95070b22 100644 (file)
@@ -734,7 +734,7 @@ opensm_main(void *OsmMainArgs)
                default:\r
                        break;\r
                }\r
-       } while (next_option != -1);\r
+       } while (next_option != -1 && next_option != '?');\r
 \r
        optind = 0;             /* reset command line */\r
 \r
@@ -1098,7 +1098,8 @@ opensm_main(void *OsmMainArgs)
                case -1:\r
                        break;  /* done with option */\r
                default:        /* something wrong */\r
-                       abort();\r
+                       show_usage();\r
+                       exit(1);\r
                }\r
        } while (next_option != -1);\r
 \r