mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
Fix ub_env_enum(): syscall() returns 0 when properly invoked.
This commit is contained in:
parent
e6d84d057a
commit
e7f42eade6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200691
|
@ -568,17 +568,16 @@ ub_env_enum(const char *last)
|
|||
const char *env, *str;
|
||||
int i;
|
||||
|
||||
env = NULL;
|
||||
|
||||
/*
|
||||
* It's OK to pass only the name piece as last (and not the whole
|
||||
* 'name=val' string), since the API_ENUM_ENV call uses envmatch()
|
||||
* internally, which handles such case
|
||||
*/
|
||||
if (!syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env))
|
||||
env = NULL;
|
||||
if (syscall(API_ENV_ENUM, NULL, (uint32_t)last, (uint32_t)&env) != 0)
|
||||
return (NULL);
|
||||
|
||||
if (!env)
|
||||
if (env == NULL)
|
||||
/* no more env. variables to enumerate */
|
||||
return (NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue