diff options
Diffstat (limited to 'usr/src/uts/common/io/log.c')
-rw-r--r-- | usr/src/uts/common/io/log.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/usr/src/uts/common/io/log.c b/usr/src/uts/common/io/log.c index 8725c97ffb..cc68e13b4f 100644 --- a/usr/src/uts/common/io/log.c +++ b/usr/src/uts/common/io/log.c @@ -20,7 +20,7 @@ * CDDL HEADER END */ /* - * Copyright 2004 Sun Microsystems, Inc. All rights reserved. + * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -87,11 +87,10 @@ log_attach(dev_info_t *devi, ddi_attach_cmd_t cmd) } /* - * log_open can be called for one of two devices, /dev/conslog or - * /dev/log. In the case of /dev/conslog it returns the global - * console device (i.e., multiple opens return the same device), while - * for /dev/log a new device is created for each open (up to a limit - * of 16 per zone). Most of the allocation details are handled in + * log_open can be called for either /dev/log or dev/conslog. + * In both cases a new minor device is created. Up to 16 /dev/log devices + * may be created per zone. Up to LOG_NUMCONS global /dev/conslog + * devices may be created. Most of the allocation details are handled in * log_alloc. */ /* ARGSUSED */ @@ -105,7 +104,7 @@ log_open(queue_t *q, dev_t *devp, int flag, int sflag, cred_t *cr) return (ENXIO); switch (minor = getminor(*devp)) { - case LOG_CONSMIN: /* normal open of /dev/conslog */ + case LOG_CONSMIN: /* clone open of /dev/conslog */ if (flag & FREAD) return (EINVAL); /* write-only device */ if (q->q_ptr) @@ -143,6 +142,8 @@ log_close(queue_t *q, int flag, cred_t *cr) log_update(lp, NULL, 0, NULL); freemsg(lp->log_data); lp->log_data = NULL; + if (lp->log_major == LOG_CONSMIN) + log_free(lp); q->q_ptr = NULL; WR(q)->q_ptr = NULL; @@ -181,8 +182,8 @@ log_wput(queue_t *q, mblk_t *mp) case M_IOCTL: iocp = (struct iocblk *)mp->b_rptr; - if (lp->log_minor <= LOG_LOGMIN) { - /* not a cloned dev_t */ + if (lp->log_major != LOG_LOGMIN) { + /* write-only device */ miocnak(q, mp, 0, EINVAL); return (0); } |