Commit 3fd4e33
committed
lib: Make parameter of ebg_env_getglobalstate obsolete
ebg_env_getglobalstate neither used nor needs a concrete environment
for retrieving the effective state over all envs. The passed parameter
has always been ignored and was probably only introduced to have a
consistent signature compared to ebg_env_setglobalstate or other
functions.
At the same time, opening and closing an env via ebg_env_open_current
and ebg_env_close is unfortunately not side-effect free which can cause
surprises to users, see e.g. [1]. It is therefore better to avoid any
needless opening of envs by officially declaring the parameter as
reserved, just asking the user to pass NULL from now on. We do not want
to change our API for existing users, though, and therefore do not
enforce the parameter to be actually NULL. Thus, users can continue to
pass valid envs as well.
However, we now need to make sure that bgenv_init is also called from
ebg_env_getglobalstate as this is otherwise done by ebg_env_create_new
or ebg_env_open_current.
[1] https://groups.google.com/g/efibootguard-dev/c/hAFE-LQ5cvc
Signed-off-by: Jan Kiszka <[email protected]>1 parent 4520209 commit 3fd4e33
2 files changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
186 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
0 commit comments