summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/strsubr.c
diff options
context:
space:
mode:
authorGarrett D'Amore <gdamore@opensolaris.org>2009-01-20 13:47:33 -0800
committerGarrett D'Amore <gdamore@opensolaris.org>2009-01-20 13:47:33 -0800
commitfcb46be354bf317d3eabf5ecd026524c0253acde (patch)
treeca8a54b96ed02723c0d22a5fc714803c62c96776 /usr/src/uts/common/os/strsubr.c
parent03494a9880d80f834bec10a1e8f0a2f8f7c97bf4 (diff)
downloadillumos-joyent-fcb46be354bf317d3eabf5ecd026524c0253acde.tar.gz
6794553 M_READ not delivered for nonblocking streams
Diffstat (limited to 'usr/src/uts/common/os/strsubr.c')
-rw-r--r--usr/src/uts/common/os/strsubr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/uts/common/os/strsubr.c b/usr/src/uts/common/os/strsubr.c
index 469ef329db..1ea4fa19db 100644
--- a/usr/src/uts/common/os/strsubr.c
+++ b/usr/src/uts/common/os/strsubr.c
@@ -23,7 +23,7 @@
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -3027,15 +3027,6 @@ strwaitq(stdata_t *stp, int flag, ssize_t count, int fmode, clock_t timout,
return (0);
}
- if (fmode & (FNDELAY|FNONBLOCK)) {
- if (!(flag & NOINTR))
- error = EAGAIN;
- else
- error = 0;
- *done = 1;
- return (error);
- }
-
if (stp->sd_flag & errs) {
/*
* Check for errors before going to sleep since the
@@ -3085,6 +3076,15 @@ strwaitq(stdata_t *stp, int flag, ssize_t count, int fmode, clock_t timout,
}
}
+ if (fmode & (FNDELAY|FNONBLOCK)) {
+ if (!(flag & NOINTR))
+ error = EAGAIN;
+ else
+ error = 0;
+ *done = 1;
+ return (error);
+ }
+
stp->sd_flag |= slpflg;
TRACE_5(TR_FAC_STREAMS_FR, TR_STRWAITQ_WAIT2,
"strwaitq sleeps (2):%p, %X, %lX, %X, %p",