mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
genksyms: use getopt_long() unconditionally
getopt_long() is used by various tools in the kernel (e.g. Kconfig). It should be fine to use it all the time. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
a19937d829
commit
96a29581e7
@ -16,9 +16,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#ifdef __GNU_LIBRARY__
|
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif /* __GNU_LIBRARY__ */
|
|
||||||
|
|
||||||
#include "genksyms.h"
|
#include "genksyms.h"
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
@ -718,7 +716,6 @@ void error_with_pos(const char *fmt, ...)
|
|||||||
static void genksyms_usage(void)
|
static void genksyms_usage(void)
|
||||||
{
|
{
|
||||||
fputs("Usage:\n" "genksyms [-adDTwqhVR] > /path/to/.tmp_obj.ver\n" "\n"
|
fputs("Usage:\n" "genksyms [-adDTwqhVR] > /path/to/.tmp_obj.ver\n" "\n"
|
||||||
#ifdef __GNU_LIBRARY__
|
|
||||||
" -d, --debug Increment the debug level (repeatable)\n"
|
" -d, --debug Increment the debug level (repeatable)\n"
|
||||||
" -D, --dump Dump expanded symbol defs (for debugging only)\n"
|
" -D, --dump Dump expanded symbol defs (for debugging only)\n"
|
||||||
" -r, --reference file Read reference symbols from a file\n"
|
" -r, --reference file Read reference symbols from a file\n"
|
||||||
@ -728,17 +725,6 @@ static void genksyms_usage(void)
|
|||||||
" -q, --quiet Disable warnings (default)\n"
|
" -q, --quiet Disable warnings (default)\n"
|
||||||
" -h, --help Print this message\n"
|
" -h, --help Print this message\n"
|
||||||
" -V, --version Print the release version\n"
|
" -V, --version Print the release version\n"
|
||||||
#else /* __GNU_LIBRARY__ */
|
|
||||||
" -d Increment the debug level (repeatable)\n"
|
|
||||||
" -D Dump expanded symbol defs (for debugging only)\n"
|
|
||||||
" -r file Read reference symbols from a file\n"
|
|
||||||
" -T file Dump expanded types into file\n"
|
|
||||||
" -p Preserve reference modversions or fail\n"
|
|
||||||
" -w Enable warnings\n"
|
|
||||||
" -q Disable warnings (default)\n"
|
|
||||||
" -h Print this message\n"
|
|
||||||
" -V Print the release version\n"
|
|
||||||
#endif /* __GNU_LIBRARY__ */
|
|
||||||
, stderr);
|
, stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,7 +733,6 @@ int main(int argc, char **argv)
|
|||||||
FILE *dumpfile = NULL, *ref_file = NULL;
|
FILE *dumpfile = NULL, *ref_file = NULL;
|
||||||
int o;
|
int o;
|
||||||
|
|
||||||
#ifdef __GNU_LIBRARY__
|
|
||||||
struct option long_opts[] = {
|
struct option long_opts[] = {
|
||||||
{"debug", 0, 0, 'd'},
|
{"debug", 0, 0, 'd'},
|
||||||
{"warnings", 0, 0, 'w'},
|
{"warnings", 0, 0, 'w'},
|
||||||
@ -763,9 +748,6 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
while ((o = getopt_long(argc, argv, "dwqVDr:T:ph",
|
while ((o = getopt_long(argc, argv, "dwqVDr:T:ph",
|
||||||
&long_opts[0], NULL)) != EOF)
|
&long_opts[0], NULL)) != EOF)
|
||||||
#else /* __GNU_LIBRARY__ */
|
|
||||||
while ((o = getopt(argc, argv, "dwqVDr:T:ph")) != EOF)
|
|
||||||
#endif /* __GNU_LIBRARY__ */
|
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case 'd':
|
case 'd':
|
||||||
flag_debug++;
|
flag_debug++;
|
||||||
|
Loading…
Reference in New Issue
Block a user