From owner-svn-src-head@FreeBSD.ORG Fri Oct 23 15:09:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 546EF106566C; Fri, 23 Oct 2009 15:09:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 432B88FC16; Fri, 23 Oct 2009 15:09:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9NF9pJa064640; Fri, 23 Oct 2009 15:09:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9NF9pj3064638; Fri, 23 Oct 2009 15:09:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200910231509.n9NF9pj3064638@svn.freebsd.org> From: John Baldwin Date: Fri, 23 Oct 2009 15:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198408 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2009 15:09:52 -0000 Author: jhb Date: Fri Oct 23 15:09:51 2009 New Revision: 198408 URL: http://svn.freebsd.org/changeset/base/198408 Log: 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 Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Fri Oct 23 14:56:29 2009 (r198407) +++ head/sys/kern/kern_shutdown.c Fri Oct 23 15:09:51 2009 (r198408) @@ -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)