Skip to content

Commit

Permalink
report more errors from global plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kodebach committed Sep 14, 2021
1 parent 09aff92 commit ec02242
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/libs/elektra/kdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,25 @@ static int elektraGetDoUpdateWithGlobalHooks (KDB * handle, Split * split, KeySe
{
case FIRST:
keySetName (parentKey, keyName (initialParent));
elektraGlobalGet (handle, ks, parentKey, GETSTORAGE, INIT);
elektraGlobalGet (handle, ks, parentKey, GETSTORAGE, MAXONCE);
if (elektraGlobalGet (handle, ks, parentKey, GETSTORAGE, INIT) == ELEKTRA_PLUGIN_ERROR)
{
return -1;
}
if (elektraGlobalGet (handle, ks, parentKey, GETSTORAGE, MAXONCE) == ELEKTRA_PLUGIN_ERROR)
{
return -1;
}
break;
case LAST:
keySetName (parentKey, keyName (initialParent));
elektraGlobalGet (handle, ks, parentKey, PROCGETSTORAGE, INIT);
elektraGlobalGet (handle, ks, parentKey, PROCGETSTORAGE, MAXONCE);
if (elektraGlobalGet (handle, ks, parentKey, PROCGETSTORAGE, INIT) == ELEKTRA_PLUGIN_ERROR)
{
return -1;
}
if (elektraGlobalGet (handle, ks, parentKey, PROCGETSTORAGE, MAXONCE) == ELEKTRA_PLUGIN_ERROR)
{
return -1;
}
elektraGlobalError (handle, ks, parentKey, PROCGETSTORAGE, DEINIT);
break;
default:
Expand Down
5 changes: 5 additions & 0 deletions tests/shell/gen/highlevel/struct.data.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mountpoint=tests_gen_elektra_struct.ini

[mystruct]
type=struct
check/type=any
default=""

[mystruct/a]
Expand All @@ -15,6 +16,7 @@ default=8

[myotherstruct]
type=struct
check/type=any
default=""
gen/struct/depth=2

Expand All @@ -28,6 +30,7 @@ default=6

[person/_]
type=struct
check/type=any
default=""
gen/struct/type=Person
gen/struct/alloc=1
Expand All @@ -47,6 +50,7 @@ default=1.80

[person/_/children/#]
type=struct_ref
check/type=any
default=""

[person/_/children]
Expand All @@ -56,6 +60,7 @@ check/reference/restrict=../../../person/_

[people/#]
type=struct_ref
check/type=any
default=""

[people]
Expand Down

0 comments on commit ec02242

Please sign in to comment.