multicall: do not call getopt_long() inside the stub applet

This commit is contained in:
Ariadne Conill 2020-11-19 03:17:57 -07:00
parent 9715b41c28
commit 46bb0565fa

View file

@ -73,6 +73,8 @@ applet_cmp(const void *a, const void *b)
void multicall_usage(int status) __attribute__((noreturn)); void multicall_usage(int status) __attribute__((noreturn));
struct if_applet ifupdown_applet;
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -92,9 +94,11 @@ main(int argc, char *argv[])
} }
self_applet = *app; self_applet = *app;
if (self_applet != &ifupdown_applet)
process_options(*app, argc, argv); process_options(*app, argc, argv);
return (*app)->main(argc, argv); return self_applet->main(argc, argv);
} }
int int
@ -106,8 +110,6 @@ multicall_main(int argc, char *argv[])
return main(argc - 1, argv + 1); return main(argc - 1, argv + 1);
} }
struct if_applet ifupdown_applet;
void void
multicall_usage(int status) multicall_usage(int status)
{ {