]> git.tue.mpg.de Git - adu.git/commitdiff
interactive.c: Return proper error on icom_set() failure.
authorAndre Noll <maan@systemlinux.org>
Wed, 15 Aug 2012 20:44:19 +0000 (22:44 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 11 Aug 2014 14:16:27 +0000 (16:16 +0200)
If an interactive set command fails, we currently reset the
configuration to the default and return success. This is probably
not what the user expected.

Make the command fail instead.

interactive.c

index 88a1bd51e0f222956533d29436b3c5afa8d5e674..8f94076c4a8bb08829b482fd830e1820251f8243 100644 (file)
@@ -110,7 +110,6 @@ static int icom_reset(__a_unused char *line)
 
 static int icom_set(char *line)
 {
-       int ret;
        struct select_cmdline_parser_params params = {
                .override = 1,
                .initialize = 0,
@@ -127,10 +126,7 @@ static int icom_set(char *line)
        fi = NULL;
        free(admissible_uids);
        admissible_uids = NULL;
-       ret = parse_select_options(line, &params, &admissible_uids, &fi);
-       if (ret >= 0)
-               return ret;
-       return icom_reset(NULL);
+       return parse_select_options(line, &params, &admissible_uids, &fi);
 }
 
 static int exec_interactive_command(char *line)