aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Jacob <mjacob@FreeBSD.org>1999-11-07 01:10:30 +0000
committerMatt Jacob <mjacob@FreeBSD.org>1999-11-07 01:10:30 +0000
commitc1dc94eeb5f2aca0d6c0d082eacb2d73b06458ba (patch)
tree3d922ce0c1636b3628302ed77015e5979519eac4
parent88002b4c388244b656b5a1ef7ece9b4a0e6354a8 (diff)
downloadsrc-c1dc94eeb5f2aca0d6c0d082eacb2d73b06458ba.tar.gz
src-c1dc94eeb5f2aca0d6c0d082eacb2d73b06458ba.zip
add in actual getenv_quad function
Notes
Notes: svn path=/head/; revision=52947
-rw-r--r--sys/kern/kern_environment.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index 527bb1f120ff..995f02566cbd 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -70,6 +70,22 @@ getenv(char *name)
int
getenv_int(char *name, int *data)
{
+ quad_t tmp;
+ int rval;
+
+ rval = getenv_quad(name, &tmp);
+ if (rval) {
+ *data = (int) tmp;
+ }
+ return (rval);
+}
+
+/*
+ * Return a quad_t value from an environment variable.
+ */
+quad_t
+getenv_quad(char *name, quad_t *data)
+{
const char *value, *vtp;
quad_t iv;
@@ -80,7 +96,7 @@ getenv_int(char *name, int *data)
if ((vtp == value) || (*vtp != 0))
return(0);
- *data = (int)iv;
+ *data = iv;
return(1);
}