From: Tokunori Ikegami Date: Sun, 30 Apr 2023 13:07:48 +0000 (+0900) Subject: util: Delete unused argconfig file types X-Git-Tag: v2.5~134 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b8e7ce2762d5f7402c8c24f8de1b6bcacde39acb;p=users%2Fsagi%2Fnvme-cli.git util: Delete unused argconfig file types Signed-off-by: Tokunori Ikegami --- diff --git a/util/argconfig.c b/util/argconfig.c index 06dde3cf..6b547b9b 100644 --- a/util/argconfig.c +++ b/util/argconfig.c @@ -166,8 +166,6 @@ static int argconfig_parse_type(struct argconfig_commandline_options *s, struct { void *value = (void *)(char *)s->default_value; char *endptr; - const char *fopts = NULL; - FILE *f; int ret = 0; char **opts = ((char **)value); int remaining_space = CFG_MAX_SUBOPTS - 2; @@ -243,36 +241,6 @@ static int argconfig_parse_type(struct argconfig_commandline_options *s, struct ret = -EINVAL; } break; - case CFG_FILE_A: - fopts = "a"; - fallthrough; - case CFG_FILE_R: - if (!fopts) - fopts = "r"; - fallthrough; - case CFG_FILE_W: - if (!fopts) - fopts = "w"; - fallthrough; - case CFG_FILE_AP: - if (!fopts) - fopts = "a+"; - fallthrough; - case CFG_FILE_RP: - if (!fopts) - fopts = "r+"; - fallthrough; - case CFG_FILE_WP: - if (!fopts) - fopts = "w+"; - f = fopen(optarg, fopts); - if (!f) { - fprintf(stderr, "Unable to open %s file: %s\n", s->option, optarg); - ret = -EINVAL; - } else { - *((FILE **)value) = f; - } - break; case CFG_FLAG: *((bool *)value) = true; break; diff --git a/util/argconfig.h b/util/argconfig.h index b7169478..f0e39f4e 100644 --- a/util/argconfig.h +++ b/util/argconfig.h @@ -54,12 +54,6 @@ enum argconfig_types { CFG_POSITIVE, CFG_INCREMENT, CFG_SUBOPTS, - CFG_FILE_A, - CFG_FILE_W, - CFG_FILE_R, - CFG_FILE_AP, - CFG_FILE_WP, - CFG_FILE_RP, }; #define OPT_ARGS(n) \