diff options
Diffstat (limited to 'common/env.c')
-rw-r--r-- | common/env.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/env.c b/common/env.c index fbaaac4f2f..2830551bc0 100644 --- a/common/env.c +++ b/common/env.c @@ -251,15 +251,21 @@ static int dev_setenv(const char *name, const char *val) return -ENODEV; } +/** + * setenv - set environment variables + * @_name - Variable name + * @value - the value to set, empty string not handled specially + * + * Returns 0 for success and a negative error code otherwise + * Use unsetenv() to unset. + */ + int setenv(const char *_name, const char *value) { char *name = strdup(_name); int ret = 0; struct list_head *list; - if (value && !*value) - value = NULL; - if (strchr(name, '.')) { ret = dev_setenv(name, value); if (ret) |