Mostly revert r219468, as I had misremembered the C standard regarding
the size of an extern array. Keep one change from strncpy to strlcpy.
This commit is contained in:
parent
e6bcbac1f7
commit
c77715ef6c
@ -1758,7 +1758,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
|
||||
|
||||
env = getenv("kernelname");
|
||||
if (env != NULL)
|
||||
strlcpy(kernelname, env, MAXPATHLEN);
|
||||
strlcpy(kernelname, env, sizeof(kernelname));
|
||||
|
||||
#ifdef XENHVM
|
||||
if (inw(0x10) == 0x49d2) {
|
||||
|
@ -792,7 +792,7 @@ ia64_init(void)
|
||||
|
||||
p = getenv("kernelname");
|
||||
if (p != NULL) {
|
||||
strlcpy(kernelname, p, MAXPATHLEN);
|
||||
strlcpy(kernelname, p, sizeof(kernelname));
|
||||
freeenv(p);
|
||||
}
|
||||
|
||||
|
@ -540,7 +540,7 @@ powerpc_init(vm_offset_t startkernel, vm_offset_t endkernel,
|
||||
*/
|
||||
env = getenv("kernelname");
|
||||
if (env != NULL) {
|
||||
strlcpy(kernelname, env, MAXPATHLEN);
|
||||
strlcpy(kernelname, env, sizeof(kernelname));
|
||||
freeenv(env);
|
||||
}
|
||||
|
||||
|
@ -532,7 +532,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
|
||||
init_param2(physmem);
|
||||
env = getenv("kernelname");
|
||||
if (env != NULL) {
|
||||
strlcpy(kernelname, env, MAXPATHLEN);
|
||||
strlcpy(kernelname, env, sizeof(kernelname));
|
||||
freeenv(env);
|
||||
}
|
||||
|
||||
|
@ -425,7 +425,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
|
||||
|
||||
env = getenv("kernelname");
|
||||
if (env != NULL) {
|
||||
strlcpy(kernelname, env, MAXPATHLEN);
|
||||
strlcpy(kernelname, env, sizeof(kernelname));
|
||||
freeenv(env);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@
|
||||
/* Global variables for the kernel. */
|
||||
|
||||
/* 1.1 */
|
||||
extern char kernelname[/*MAXPATHLEN*/];
|
||||
extern char kernelname[MAXPATHLEN];
|
||||
|
||||
extern int tick; /* usec per tick (1000000 / hz) */
|
||||
extern int hz; /* system clock's frequency */
|
||||
|
Loading…
Reference in New Issue
Block a user