summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-06-15 07:29:17 +0000
committerpeter <peter@FreeBSD.org>2001-06-15 07:29:17 +0000
commit51d35ea75c62797bc9adc5cbcaf1cc7e61bdb006 (patch)
treed4827780e83c4a34280184076c79bcdba8df4665
parent184cadbfacf5d257694009f096f3358e466e0cb7 (diff)
downloadFreeBSD-src-51d35ea75c62797bc9adc5cbcaf1cc7e61bdb006.zip
FreeBSD-src-51d35ea75c62797bc9adc5cbcaf1cc7e61bdb006.tar.gz
Fix some warnings in kern_environment.c. Make the getenv*() family
take a const 'name', since they dont modify anything. 159: warning: passing arg 1 of `getenv_int' discards qualifiers... 167: warning: passing arg 1 of `getenv' discards qualifiers from pointer..
-rw-r--r--sys/kern/kern_environment.c6
-rw-r--r--sys/sys/systm.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c
index 561f63d..6769c06 100644
--- a/sys/kern/kern_environment.c
+++ b/sys/kern/kern_environment.c
@@ -47,7 +47,7 @@ char *kern_envp;
static char *kernenv_next(char *cp);
char *
-getenv(char *name)
+getenv(const char *name)
{
char *cp, *ep;
int len;
@@ -68,7 +68,7 @@ getenv(char *name)
* Return an integer value from an environment variable.
*/
int
-getenv_int(char *name, int *data)
+getenv_int(const char *name, int *data)
{
quad_t tmp;
int rval;
@@ -84,7 +84,7 @@ getenv_int(char *name, int *data)
* Return a quad_t value from an environment variable.
*/
quad_t
-getenv_quad(char *name, quad_t *data)
+getenv_quad(const char *name, quad_t *data)
{
const char *value;
char *vtp;
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 32f9d16..aa95807 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -168,9 +168,9 @@ int suser __P((struct proc *));
int suser_xxx __P((struct ucred *cred, struct proc *proc, int flag));
int u_cansee __P((struct ucred *u1, struct ucred *u2));
-char *getenv __P((char *name));
-int getenv_int __P((char *name, int *data));
-quad_t getenv_quad __P((char *name, quad_t *data));
+char *getenv __P((const char *name));
+int getenv_int __P((const char *name, int *data));
+quad_t getenv_quad __P((const char *name, quad_t *data));
extern char *kern_envp;
#ifdef APM_FIXUP_CALLTODO
OpenPOWER on IntegriCloud