diff options
author | dd <dd@FreeBSD.org> | 2002-03-11 03:48:32 +0000 |
---|---|---|
committer | dd <dd@FreeBSD.org> | 2002-03-11 03:48:32 +0000 |
commit | 3a71779f4de4d423cf03a6c4170053e267fb9287 (patch) | |
tree | 28adae704b3a59c6ef46c3254a95c3c58af0cea8 /sys/dev | |
parent | bef62c8ae4f38f6c19f75826cc852e95fe1dcd17 (diff) | |
download | FreeBSD-src-3a71779f4de4d423cf03a6c4170053e267fb9287.zip FreeBSD-src-3a71779f4de4d423cf03a6c4170053e267fb9287.tar.gz |
Make the diagnostics printfs less ugly.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/snp/snp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index 8c900d8..a72940b 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -63,6 +63,7 @@ static struct linesw snpdisc = { */ struct snoop { LIST_ENTRY(snoop) snp_list; /* List glue. */ + int snp_unit; /* Device number. */ dev_t snp_target; /* Target tty device. */ struct tty *snp_tty; /* Target tty pointer. */ u_long snp_len; /* Possible length. */ @@ -211,7 +212,7 @@ snpwrite(dev, uio, flag) tp->t_line == snooplinedisc) goto tty_input; - printf("Snoop: attempt to write to bad tty.\n"); + printf("snp%d: attempt to write to bad tty\n", snp->snp_unit); return (EIO); tty_input: @@ -314,12 +315,12 @@ snp_in(snp, buf, n) return (0); if (snp->snp_flags & SNOOP_DOWN) { - printf("Snoop: more data to down interface.\n"); + printf("snp%d: more data to down interface\n", snp->snp_unit); return (0); } if (snp->snp_flags & SNOOP_OFLOW) { - printf("Snoop: buffer overflow.\n"); + printf("snp%d: buffer overflow\n", snp->snp_unit); /* * On overflow we just repeat the standart close * procedure...yes , this is waste of space but.. Then next @@ -392,6 +393,7 @@ snpopen(dev, flag, mode, td) 0600, "snp%d", dev2unit(dev)); dev->si_drv1 = snp = malloc(sizeof(*snp), M_SNP, M_WAITOK | M_ZERO); + snp->snp_unit = dev2unit(dev); } else return (EBUSY); @@ -440,7 +442,7 @@ snp_detach(snp) tp->t_state &= ~TS_SNOOP; tp->t_line = snp->snp_olddisc; } else - printf("Snoop: bad attached tty data.\n"); + printf("snp%d: bad attached tty data\n", snp->snp_unit); snp->snp_tty = NULL; snp->snp_target = NODEV; |