Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2008 20:38:31 GMT
From:      Ed Schouten <ed@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 145036 for review
Message-ID:  <200807102038.m6AKcV7S076058@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=145036

Change 145036 by ed@ed_dull on 2008/07/10 20:38:19

	Use braces instead of quotes for the process name. Also print a
	similar warning when processes allocate PTY's without calling
	posix_openpt(2).

Affected files ...

.. //depot/projects/mpsafetty/sys/dev/pts/pts.c#2 edit
.. //depot/projects/mpsafetty/sys/dev/ptycompat/ptycompat.c#2 edit

Differences ...

==== //depot/projects/mpsafetty/sys/dev/pts/pts.c#2 (text+ko) ====

@@ -591,12 +591,22 @@
 }
 
 #if defined(PTS_COMPAT) || defined(PTS_LINUX)
+static int pts_warningcnt = 10;
+
 static int
 ptmx_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
 {
 	if (pts_alloc(fflags & (FREAD|FWRITE), td, fp) == NULL)
 		return (EAGAIN);
 
+	/* Raise a warning when a legacy PTY has been allocated */
+	if (pts_warningcnt > 0) {
+		pts_warningcnt--;
+		printf("pid %d (%s) is using legacy pts allocation%s\n", 
+		    td->td_proc->p_pid, td->td_name,
+		    pts_warningcnt ? "" : " - not logging anymore");
+	}
+
 	return (0);
 }
 

==== //depot/projects/mpsafetty/sys/dev/ptycompat/ptycompat.c#2 (text+ko) ====

@@ -86,7 +86,7 @@
 	/* 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", 
+		printf("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?200807102038.m6AKcV7S076058>