From owner-svn-src-head@FreeBSD.ORG Wed Aug 19 14:30:46 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 90DCE10656B1; Wed, 19 Aug 2009 14:30:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80E0D8FC62; Wed, 19 Aug 2009 14:30:46 +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 n7JEUkDY056765; Wed, 19 Aug 2009 14:30:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n7JEUkGt056763; Wed, 19 Aug 2009 14:30:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200908191430.n7JEUkGt056763@svn.freebsd.org> From: Ed Schouten Date: Wed, 19 Aug 2009 14:30:46 +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: r196378 - 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: Wed, 19 Aug 2009 14:30:46 -0000 Author: ed Date: Wed Aug 19 14:30:46 2009 New Revision: 196378 URL: http://svn.freebsd.org/changeset/base/196378 Log: Small changes to the warning message generated by pty(4): - Only print the warning once, instead of filling up the screen. - Use the word "legacy" for the pty_warningcnt description, to prevent confusion. - Use log() instead of printf(). Discussed with: rwatson, jhb Approved by: re (kib) Modified: head/sys/kern/tty_pty.c Modified: head/sys/kern/tty_pty.c ============================================================================== --- head/sys/kern/tty_pty.c Wed Aug 19 12:12:51 2009 (r196377) +++ head/sys/kern/tty_pty.c Wed Aug 19 14:30:46 2009 (r196378) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,10 +48,10 @@ __FBSDID("$FreeBSD$"); * si_drv1 inside the cdev to mark whether the PTY is in use. */ -static unsigned int pty_warningcnt = 10; +static unsigned int pty_warningcnt = 1; SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW, &pty_warningcnt, 0, - "Warnings that will be triggered upon PTY allocation"); + "Warnings that will be triggered upon legacy PTY allocation"); static int ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp) @@ -74,7 +75,7 @@ ptydev_fdopen(struct cdev *dev, int ffla /* Raise a warning when a legacy PTY has been allocated. */ if (pty_warningcnt > 0) { pty_warningcnt--; - printf("pid %d (%s) is using legacy pty devices%s\n", + log(LOG_INFO, "pid %d (%s) is using legacy pty devices%s\n", td->td_proc->p_pid, td->td_name, pty_warningcnt ? "" : " - not logging anymore"); }