Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Aug 2009 14:38:44 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r196379 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern
Message-ID:  <200908191438.n7JEcigk056990@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Aug 19 14:38:43 2009
New Revision: 196379
URL: http://svn.freebsd.org/changeset/base/196379

Log:
  MFC r196378:
  
    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:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/tty_pty.c

Modified: stable/8/sys/kern/tty_pty.c
==============================================================================
--- stable/8/sys/kern/tty_pty.c	Wed Aug 19 14:30:46 2009	(r196378)
+++ stable/8/sys/kern/tty_pty.c	Wed Aug 19 14:38:43 2009	(r196379)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/kernel.h>
 #include <sys/proc.h>
 #include <sys/sysctl.h>
+#include <sys/syslog.h>
 #include <sys/systm.h>
 #include <sys/tty.h>
 
@@ -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");
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908191438.n7JEcigk056990>