From 4f9d48e478f0b7d6f05938be6227349dc6514d96 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 23 Oct 2009 15:09:51 +0000 Subject: [PATCH] Don't bother copying the name of a kproc or kthread out into a temporary array just to pass that array to printf(). kproc and kthread names are NUL-terminated and can be printed using printf() directly. Reviewed by: bde --- sys/kern/kern_shutdown.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 6534d5c55414..3d963213597c 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -618,16 +618,14 @@ void kproc_shutdown(void *arg, int howto) { struct proc *p; - char procname[MAXCOMLEN + 1]; int error; if (panicstr) return; p = (struct proc *)arg; - strlcpy(procname, p->p_comm, sizeof(procname)); printf("Waiting (max %d seconds) for system process `%s' to stop...", - kproc_shutdown_wait, procname); + kproc_shutdown_wait, p->p_comm); error = kproc_suspend(p, kproc_shutdown_wait * hz); if (error == EWOULDBLOCK) @@ -640,16 +638,14 @@ void kthread_shutdown(void *arg, int howto) { struct thread *td; - char procname[MAXCOMLEN + 1]; int error; if (panicstr) return; td = (struct thread *)arg; - strlcpy(procname, td->td_name, sizeof(procname)); printf("Waiting (max %d seconds) for system thread `%s' to stop...", - kproc_shutdown_wait, procname); + kproc_shutdown_wait, td->td_name); error = kthread_suspend(td, kproc_shutdown_wait * hz); if (error == EWOULDBLOCK)