@@ -135,8 +135,7 @@ struct ibdiag_opt {
extern int ibdiag_process_opts(int argc, char *const argv[], void *context,
const char *exclude_common_str,
const struct ibdiag_opt custom_opts[],
- int (*custom_handler) (void *cxt, int val,
- char *optarg),
+ int (*custom_handler) (void *cxt, int val),
const char *usage_args,
const char *usage_examples[]);
extern void ibdiag_show_usage(void);
@@ -42,7 +42,6 @@
#include <unistd.h>
#include <string.h>
#include <inttypes.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <assert.h>
@@ -394,7 +393,7 @@ static void process_switch(ibnd_node_t *node, void *fabric)
dump_node(node, srcport, (ibnd_fabric_t *)fabric);
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'a':
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <getopt.h>
#include <arpa/inet.h>
#include <infiniband/umad.h>
@@ -91,7 +90,7 @@ static int ib_resolve_addr(ib_portid_t * portid, int portnum, int show_lid,
static int show_lid, show_gid;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'g':
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <getopt.h>
#include <inttypes.h>
#include <infiniband/mad.h>
@@ -126,7 +125,7 @@ static int parse_guidbeforeafter(char *arg,
return 0;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 1:
@@ -41,7 +41,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <getopt.h>
#include <errno.h>
#include <netinet/in.h>
#include <limits.h>
@@ -545,7 +544,7 @@ static const char *congestion_control_table(ib_portid_t *dest, char **argv,
return NULL;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'c':
@@ -41,7 +41,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <getopt.h>
#include <netinet/in.h>
#define __STDC_FORMAT_MACROS
@@ -340,7 +339,7 @@ static const char *timestamp_dump(ib_portid_t *dest, char **argv, int argc)
return NULL;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'c':
@@ -212,7 +212,7 @@ void ibdiag_show_usage(void)
exit(2);
}
-static int process_opt(int ch, char *optarg)
+static int process_opt(int ch)
{
char *endp;
long val;
@@ -373,8 +373,7 @@ static void make_str_opts(const struct option *o, char *p, unsigned size)
int ibdiag_process_opts(int argc, char *const argv[], void *cxt,
const char *exclude_common_str,
const struct ibdiag_opt custom_opts[],
- int (*custom_handler) (void *cxt, int val,
- char *optarg),
+ int (*custom_handler) (void *cxt, int val),
const char *usage_args, const char *usage_examples[])
{
char str_opts[1024];
@@ -403,10 +402,10 @@ int ibdiag_process_opts(int argc, char *const argv[], void *cxt,
if (!o)
ibdiag_show_usage();
if (custom_handler) {
- if (custom_handler(cxt, ch, optarg) &&
- process_opt(ch, optarg))
+ if (custom_handler(cxt, ch) &&
+ process_opt(ch))
ibdiag_show_usage();
- } else if (process_opt(ch, optarg))
+ } else if (process_opt(ch))
ibdiag_show_usage();
}
@@ -45,7 +45,6 @@
#include <stdarg.h>
#include <time.h>
#include <string.h>
-#include <getopt.h>
#include <errno.h>
#include <inttypes.h>
@@ -513,7 +512,7 @@ static int diff_node(ibnd_node_t *node, ibnd_fabric_t *orig_fabric,
return 0;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
struct ibnd_config *cfg = context;
char *p;
@@ -44,7 +44,6 @@
#include <unistd.h>
#include <time.h>
#include <string.h>
-#include <getopt.h>
#include <inttypes.h>
#include <infiniband/umad.h>
@@ -991,7 +990,7 @@ static int diff(ibnd_fabric_t *orig_fabric, ibnd_fabric_t *new_fabric)
static int list, group, ports_report;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
struct ibnd_config *cfg = context;
char *p;
@@ -40,7 +40,6 @@
#include <unistd.h>
#include <string.h>
#include <signal.h>
-#include <getopt.h>
#include <time.h>
#include <infiniband/umad.h>
@@ -175,7 +174,7 @@ static void report(int sig)
static int server = 0, flood = 0;
static unsigned count = ~0;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'c':
@@ -41,7 +41,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <getopt.h>
#include <errno.h>
#include <infiniband/umad.h>
@@ -46,7 +46,6 @@
#include <stdarg.h>
#include <time.h>
#include <string.h>
-#include <getopt.h>
#include <errno.h>
#include <inttypes.h>
@@ -899,7 +898,7 @@ static void calculate_suppressed_fields(char *str)
free(tmp);
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
struct ibnd_config *cfg = context;
switch (ch) {
@@ -41,7 +41,6 @@
#include <unistd.h>
#include <string.h>
#include <inttypes.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <infiniband/umad.h>
@@ -396,7 +395,7 @@ static const char *dump_unicast_tables(ib_portid_t *portid, int startlid,
return 0;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'a':
@@ -43,7 +43,6 @@
#include <string.h>
#define _GNU_SOURCE
-#include <getopt.h>
#include <infiniband/mad.h>
#include <iba/ib_types.h>
@@ -42,7 +42,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -260,7 +259,7 @@ static int ports_list(char names[][UMAD_CA_NAME_LEN], int n)
static int list_only, short_format, list_ports;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'l':
@@ -39,7 +39,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <getopt.h>
#include <infiniband/umad.h>
#include <infiniband/mad.h>
@@ -296,7 +295,7 @@ static int build_cpuinfo(void)
return ncpu;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'o':
@@ -42,7 +42,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <inttypes.h>
@@ -756,7 +755,7 @@ static int resolve_lid(ib_portid_t *portid)
static int dumplevel = 2, multicast, mlid;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 1:
@@ -41,7 +41,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <infiniband/umad.h>
@@ -716,7 +715,7 @@ static void dump_portsamples_control(ib_portid_t *portid, int port)
port, buf);
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'x':
@@ -50,7 +50,6 @@
#include <errno.h>
#define _GNU_SOURCE
-#include <getopt.h>
#include <infiniband/umad.h>
#include <infiniband/mad.h>
@@ -1521,7 +1520,7 @@ static enum saquery_command command = SAQUERY_CMD_QUERY;
static uint16_t query_type;
static char *src_lid, *dst_lid;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
struct query_params *p = context;
@@ -40,7 +40,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
-#include <getopt.h>
#include <infiniband/umad.h>
#include <infiniband/mad.h>
@@ -74,7 +73,7 @@ const char *const statestr[] = {
static unsigned act;
static int prio, state = SMINFO_STANDBY;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 'a':
@@ -42,7 +42,6 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <endian.h>
@@ -152,7 +151,7 @@ static int str2DRPath(char *str, DRPath * path)
static int dump_char, mgmt_class = IB_SMI_CLASS;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 's':
@@ -40,7 +40,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
-#include <getopt.h>
#include <netinet/in.h>
#define __STDC_FORMAT_MACROS
@@ -411,7 +410,7 @@ static const char *guid_info(ib_portid_t *dest, char **argv, int argc)
return 0;
}
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
switch (ch) {
case 1:
@@ -39,7 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <getopt.h>
#include <netinet/in.h>
#include <infiniband/umad.h>
@@ -291,7 +290,7 @@ static is3_config_space_t write_cs, read_cs;
static unsigned write_cs_records, read_cs_records;
-static int process_opt(void *context, int ch, char *optarg)
+static int process_opt(void *context, int ch)
{
int ret;
switch (ch) {