]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup get_config_hooks()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 16:17:52 +0000 (17:17 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 16:17:52 +0000 (17:17 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index f93242f65528b33f803fd5a74ada8995a504f0a5..09007d90dc6a04617ab2c8d4ec262b64eaa6a661 100644 (file)
@@ -3979,14 +3979,14 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
 
        subkey = strchr(key, '.');
        if (!subkey)
-               return -1;
+               return ret_errno(EINVAL);
 
        subkey = strchr(subkey + 1, '.');
        if (!subkey)
-               return -1;
+               return ret_errno(EINVAL);
        subkey++;
        if (*subkey == '\0')
-               return -1;
+               return ret_errno(EINVAL);
 
        for (i = 0; i < NUM_LXC_HOOKS; i++) {
                if (strcmp(lxchook_names[i], subkey) == 0) {
@@ -3996,7 +3996,7 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
        }
 
        if (found == -1)
-               return -1;
+               return ret_errno(EINVAL);
 
        if (!retv)
                inlen = 0;