9
0
Fork 0

globalvar: Do not modify already existing variables

When globalvar_add_simple was called on previously existing variables
then the value was overwritten, even when value was passed as NULL.
Do not overwrite the value in this case which allows us to do a 'global'
on the same variable multiple times without loosing the values.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-09-25 17:15:23 +02:00
parent 61d6a8485d
commit 4973077872
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ int globalvar_add_simple(const char *name, const char *value)
if (ret && ret != -EEXIST)
return ret;
if (!value)
return 0;
return dev_set_param(&global_device, name, value);
}