summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-07-28 11:43:25 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-07-28 11:43:25 +0000
commitcc9d6d44c8da4aac990e6a17890358f21cdeaf6b (patch)
tree3783aa27dabd152790b4eb34b65fb058f1dc0c87 /sys/dev
parentd9d0114bbc669037ff93704fbb0a88af7aa8dd39 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pty/pty.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/pty/pty.c b/sys/dev/pty/pty.c
index 5036cb292349..ad34e1188d5d 100644
--- a/sys/dev/pty/pty.c
+++ b/sys/dev/pty/pty.c
@@ -52,10 +52,10 @@ __FBSDID("$FreeBSD$");
* binary emulation.
*/
-static unsigned int pty_warningcnt = 1;
+static unsigned pty_warningcnt = 1;
SYSCTL_UINT(_kern, OID_AUTO, tty_pty_warningcnt, CTLFLAG_RW,
- &pty_warningcnt, 0,
- "Warnings that will be triggered upon legacy PTY allocation");
+ &pty_warningcnt, 0,
+ "Warnings that will be triggered upon legacy PTY allocation");
static int
ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
@@ -77,12 +77,7 @@ ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
}
/* Raise a warning when a legacy PTY has been allocated. */
- if (pty_warningcnt > 0) {
- pty_warningcnt--;
- 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");
- }
+ counted_warning(&pty_warningcnt, "is using legacy pty devices");
return (0);
}