]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
util: Delete unused argconfig file types
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 30 Apr 2023 13:07:48 +0000 (22:07 +0900)
committerDaniel Wagner <wagi@monom.org>
Tue, 2 May 2023 09:35:10 +0000 (11:35 +0200)
Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
util/argconfig.c
util/argconfig.h

index 06dde3cfa413937a50c6e01cb8bc6a9ac771e075..6b547b9b21934d93f084445093162f294af445af 100644 (file)
@@ -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;
index b71694781122ab30d24de60acdde586f83b14094..f0e39f4ef4991d3532f7f77a8d9ce032749db1b9 100644 (file)
@@ -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) \