usr/src/uts/common/os/strsubr.c
changeset 5360 96c808cd96bc
parent 3932 efce29b04ab4
child 5753 d64b1f799526
--- a/usr/src/uts/common/os/strsubr.c	Mon Oct 29 13:55:58 2007 -0700
+++ b/usr/src/uts/common/os/strsubr.c	Mon Oct 29 14:07:16 2007 -0700
@@ -7566,9 +7566,13 @@
 	 */
 	mutex_enter(QLOCK(q));
 	/*
-	 * If both q_count and q_mblkcnt are less than the hiwat mark
-	 */
-	if ((q->q_count < q->q_hiwat) && (q->q_mblkcnt < q->q_hiwat)) {
+	 * If queue is empty i.e q_mblkcnt is zero, queue can not be full.
+	 * Hence clear the QFULL.
+	 * If both q_count and q_mblkcnt are less than the hiwat mark,
+	 * clear the QFULL.
+	 */
+	if (q->q_mblkcnt == 0 || ((q->q_count < q->q_hiwat) &&
+	    (q->q_mblkcnt < q->q_hiwat))) {
 		q->q_flag &= ~QFULL;
 		/*
 		 * A little more confusing, how about this way: