PERFORCE change 145036 for review

Ed Schouten ed at FreeBSD.org
Thu Jul 10 20:38:32 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=145036

Change 145036 by ed at 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");
 	}


More information about the p4-projects mailing list