confile: cleanup get_config_hooks()

parent 2e5db3a2
...@@ -3979,14 +3979,14 @@ static int get_config_hooks(const char *key, char *retv, int inlen, ...@@ -3979,14 +3979,14 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
subkey = strchr(key, '.'); subkey = strchr(key, '.');
if (!subkey) if (!subkey)
return -1; return ret_errno(EINVAL);
subkey = strchr(subkey + 1, '.'); subkey = strchr(subkey + 1, '.');
if (!subkey) if (!subkey)
return -1; return ret_errno(EINVAL);
subkey++; subkey++;
if (*subkey == '\0') if (*subkey == '\0')
return -1; return ret_errno(EINVAL);
for (i = 0; i < NUM_LXC_HOOKS; i++) { for (i = 0; i < NUM_LXC_HOOKS; i++) {
if (strcmp(lxchook_names[i], subkey) == 0) { if (strcmp(lxchook_names[i], subkey) == 0) {
...@@ -3996,7 +3996,7 @@ static int get_config_hooks(const char *key, char *retv, int inlen, ...@@ -3996,7 +3996,7 @@ static int get_config_hooks(const char *key, char *retv, int inlen,
} }
if (found == -1) if (found == -1)
return -1; return ret_errno(EINVAL);
if (!retv) if (!retv)
inlen = 0; inlen = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment