diff options
author | jkim <jkim@FreeBSD.org> | 2010-10-05 18:38:23 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-10-05 18:38:23 +0000 |
commit | e9d0730bf8cda999f33c4fbfd19e3e07dd74fbe3 (patch) | |
tree | 0b7950a050dc69f2c03eb6e3edbe61309e483e43 | |
parent | 306dfd834d94e6a3ebf9ea15c35486b2b5939284 (diff) | |
download | FreeBSD-src-e9d0730bf8cda999f33c4fbfd19e3e07dd74fbe3.zip FreeBSD-src-e9d0730bf8cda999f33c4fbfd19e3e07dd74fbe3.tar.gz |
Prefer pmap_unmapbios() over pmap_unmapdev(). The binary does not change
after this because pmap_unmapbios() is a macro for pmap_unmapdev() on amd64.
-rw-r--r-- | sys/compat/x86bios/x86bios.c | 2 | ||||
-rw-r--r-- | usr.sbin/pw/pw_user.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 465a076..493be05 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -679,7 +679,7 @@ x86bios_unmap_mem(void) free(x86bios_map, M_DEVBUF); if (x86bios_ivt != NULL) #ifdef X86BIOS_NATIVE_ARCH - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); + pmap_unmapbios((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); #else free(x86bios_ivt, M_DEVBUF); #endif diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index c8364ca..dd92c43 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -151,14 +151,14 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) cnf->home = arg->val; } + dmode = S_IRWXU | S_IRWXG | S_IRWXO; if ((arg = getarg(args, 'M')) != NULL) { dmode_c = arg->val; if ((set = setmode(dmode_c)) == NULL) errx(EX_DATAERR, "invalid directory creation mode '%s'", dmode_c); - dmode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO); + cnf->homemode = getmode(set, dmode); free(set); - cnf->homemode = dmode; } /* @@ -186,7 +186,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) if (strchr(cnf->home+1, '/') == NULL) { strcpy(dbuf, "/usr"); strncat(dbuf, cnf->home, MAXPATHLEN-5); - if (mkdir(dbuf, cnf->homemode) != -1 || errno == EEXIST) { + if (mkdir(dbuf, dmode) != -1 || errno == EEXIST) { chown(dbuf, 0, 0); /* * Skip first "/" and create symlink: @@ -202,7 +202,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) while ((p = strchr(++p, '/')) != NULL) { *p = '\0'; if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) + if (mkdir(dbuf, dmode) == -1) goto direrr; chown(dbuf, 0, 0); } else if (!S_ISDIR(st.st_mode)) @@ -211,7 +211,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) } } if (stat(dbuf, &st) == -1) { - if (mkdir(dbuf, cnf->homemode) == -1) { + if (mkdir(dbuf, dmode) == -1) { direrr: err(EX_OSFILE, "mkdir '%s'", dbuf); } chown(dbuf, 0, 0); |