From owner-p4-projects@FreeBSD.ORG Thu Jul 10 20:38:32 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1A6DF106567D; Thu, 10 Jul 2008 20:38:32 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D14CC1065674 for ; Thu, 10 Jul 2008 20:38:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C67548FC22 for ; Thu, 10 Jul 2008 20:38:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m6AKcVig076060 for ; Thu, 10 Jul 2008 20:38:31 GMT (envelope-from ed@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m6AKcV7S076058 for perforce@freebsd.org; Thu, 10 Jul 2008 20:38:31 GMT (envelope-from ed@FreeBSD.org) Date: Thu, 10 Jul 2008 20:38:31 GMT Message-Id: <200807102038.m6AKcV7S076058@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to ed@FreeBSD.org using -f From: Ed Schouten To: Perforce Change Reviews Cc: Subject: PERFORCE change 145036 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2008 20:38:32 -0000 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"); }