[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1298315883.2608.70.camel@bwh-desktop>
Date: Mon, 21 Feb 2011 19:18:03 +0000
From: Ben Hutchings <bhutchings@...arflare.com>
To: netdev@...r.kernel.org
Subject: [PATCH ethtool 2/5] ethtool: Report an error if given an
unrecognised option
Previously we would print full usage information and return 0.
Signed-off-by: Ben Hutchings <bhutchings@...arflare.com>
---
ethtool.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ethtool.c b/ethtool.c
index b9422d3..d28f1b2 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -807,10 +807,11 @@ static void parse_cmdline(int argc, char **argp)
mode = args[k].Mode;
break;
}
- if (mode == MODE_HELP ||
- (!args[k].srt && argp[i][0] == '-')) {
+ if (mode == MODE_HELP) {
show_usage();
exit(0);
+ } else if (!args[k].srt && argp[i][0] == '-') {
+ exit_bad_args();
} else {
devname = argp[i];
}
--
1.7.3.4
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists