diff options
author | Davide Italiano <davide@FreeBSD.org> | 2014-10-16 18:04:43 +0000 |
---|---|---|
committer | Davide Italiano <davide@FreeBSD.org> | 2014-10-16 18:04:43 +0000 |
commit | 2be111bf7dda0f18d645f0e201b6555bbe3da1ac (patch) | |
tree | f232fa8c3b1009450da57b71fb0323893520f81c /sys/nfs | |
parent | 148bdd15d5cb3873e94e61b2678ce2ad208e3a93 (diff) | |
download | src-test2-2be111bf7dda0f18d645f0e201b6555bbe3da1ac.tar.gz src-test2-2be111bf7dda0f18d645f0e201b6555bbe3da1ac.zip |
Follow up to r225617. In order to maximize the re-usability of kernel code
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv().
This fixes a namespace collision with libc symbols.
Submitted by: kmacy
Tested by: make universe
Notes
Notes:
svn path=/head/; revision=273174
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/bootp_subr.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_diskless.c | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/sys/nfs/bootp_subr.c b/sys/nfs/bootp_subr.c index 83a3d0731117..5e3145e8dfbe 100644 --- a/sys/nfs/bootp_subr.c +++ b/sys/nfs/bootp_subr.c @@ -1452,7 +1452,7 @@ bootpc_decode_reply(struct nfsv3_diskless *nd, struct bootpc_ifcontext *ifctx, * the server value). */ p = NULL; - if ((s = getenv("vfs.root.mountfrom")) != NULL) { + if ((s = kern_getenv("vfs.root.mountfrom")) != NULL) { if ((p = strstr(s, "nfs:")) != NULL) p = strdup(p + 4, M_TEMP); freeenv(s); @@ -1723,7 +1723,7 @@ retry: if (gctx->gotrootpath != 0) { - setenv("boot.netif.name", ifctx->ifp->if_xname); + kern_setenv("boot.netif.name", ifctx->ifp->if_xname); error = md_mount(&nd->root_saddr, nd->root_hostnam, nd->root_fh, &nd->root_fhsize, diff --git a/sys/nfs/nfs_diskless.c b/sys/nfs/nfs_diskless.c index 26f5036b47fc..3882007dff0f 100644 --- a/sys/nfs/nfs_diskless.c +++ b/sys/nfs/nfs_diskless.c @@ -175,7 +175,7 @@ nfs_setup_diskless(void) return; /* get handle size. If this succeeds, it's an NFSv3 setup. */ - if ((cp = getenv("boot.nfsroot.nfshandlelen")) != NULL) { + if ((cp = kern_getenv("boot.nfsroot.nfshandlelen")) != NULL) { cnt = sscanf(cp, "%d", &len); freeenv(cp); if (cnt != 1 || len == 0 || len > NFSX_V3FHMAX) { @@ -237,7 +237,7 @@ nfs_setup_diskless(void) printf("nfs_diskless: no interface\n"); return; /* no matching interface */ match_done: - setenv("boot.netif.name", ifp->if_xname); + kern_setenv("boot.netif.name", ifp->if_xname); if (is_nfsv3 != 0) { strlcpy(nd3->myif.ifra_name, ifp->if_xname, sizeof(nd3->myif.ifra_name)); @@ -267,11 +267,11 @@ match_done: printf("nfs_diskless: bad NFS handle len=%d\n", fhlen); return; } - if ((cp = getenv("boot.nfsroot.path")) != NULL) { + if ((cp = kern_getenv("boot.nfsroot.path")) != NULL) { strncpy(nd3->root_hostnam, cp, MNAMELEN - 1); freeenv(cp); } - if ((cp = getenv("boot.nfsroot.options")) != NULL) { + if ((cp = kern_getenv("boot.nfsroot.options")) != NULL) { nfs_parse_options(cp, &nd3->root_args); freeenv(cp); } @@ -301,11 +301,11 @@ match_done: printf("nfs_diskless: no NFS handle\n"); return; } - if ((cp = getenv("boot.nfsroot.path")) != NULL) { + if ((cp = kern_getenv("boot.nfsroot.path")) != NULL) { strncpy(nd->root_hostnam, cp, MNAMELEN - 1); freeenv(cp); } - if ((cp = getenv("boot.nfsroot.options")) != NULL) { + if ((cp = kern_getenv("boot.nfsroot.options")) != NULL) { struct nfs_args args; /* @@ -339,7 +339,7 @@ inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa) sa->sin_len = sizeof(*sa); sa->sin_family = AF_INET; - if ((cp = getenv(ev)) == NULL) + if ((cp = kern_getenv(ev)) == NULL) return (1); count = sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]); freeenv(cp); @@ -362,7 +362,7 @@ hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa) sa->sdl_family = AF_LINK; sa->sdl_type = IFT_ETHER; sa->sdl_alen = ETHER_ADDR_LEN; - if ((cp = getenv(ev)) == NULL) + if ((cp = kern_getenv(ev)) == NULL) return (1); count = sscanf(cp, "%x:%x:%x:%x:%x:%x", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]); @@ -384,7 +384,7 @@ decode_nfshandle(char *ev, u_char *fh, int maxfh) u_char *cp, *ep; int len, val; - ep = cp = getenv(ev); + ep = cp = kern_getenv(ev); if (cp == NULL) return (0); if ((strlen(cp) < 2) || (*cp != 'X')) { |