summaryrefslogtreecommitdiffstats
path: root/common/env_attr.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:32 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:56 -0700
commit30fd4fadb319d7c6d43d949e2d30ffaea46a60cf (patch)
treecedfa8c38a45f3f6afe046a999003e56a609c84d /common/env_attr.c
parent2598090b7e17f8bdca95b22e7f27217054730e02 (diff)
downloadtalos-obmc-uboot-30fd4fadb319d7c6d43d949e2d30ffaea46a60cf.tar.gz
talos-obmc-uboot-30fd4fadb319d7c6d43d949e2d30ffaea46a60cf.zip
tools/env: Add environment variable flags support
Currently just validates variable types as decimal, hexidecimal, boolean, ip address, and mac address. Call env_acl_validate_setenv_params() from setenv() in fw_env.c. If the entry is not found in the env .flags, then look in the static one. This allows the env to override the static definitions, but prevents the need to have every definition in the environment distracting you. Need to build in _ctype for isdigit for Linux. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common/env_attr.c')
-rw-r--r--common/env_attr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/env_attr.c b/common/env_attr.c
index 7d330a58bb..210c98dcfd 100644
--- a/common/env_attr.c
+++ b/common/env_attr.c
@@ -21,7 +21,14 @@
* MA 02111-1307 USA
*/
+#ifdef USE_HOSTCC /* Eliminate "ANSI does not permit..." warnings */
+#include <stdint.h>
+#include <stdio.h>
+#include <linux/linux_string.h>
+#else
#include <common.h>
+#endif
+
#include <env_attr.h>
#include <errno.h>
#include <linux/string.h>
OpenPOWER on IntegriCloud