Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115958959
D29544.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
539 B
Referenced Files
None
Subscribers
None
D29544.diff
View Options
diff --git a/sys/kern/subr_sbuf.c b/sys/kern/subr_sbuf.c
--- a/sys/kern/subr_sbuf.c
+++ b/sys/kern/subr_sbuf.c
@@ -388,8 +388,12 @@
{
int len;
- KASSERT(s->s_len > 0, ("Shouldn't drain empty sbuf %p", s));
- KASSERT(s->s_error == 0, ("Called %s with error on %p", __func__, s));
+ /*
+ * Immediately return when no work to do,
+ * or an error has already been accumulated.
+ */
+ if ((s->s_len == 0) || (s->s_error != 0))
+ return(s->s_error);
if (SBUF_DODRAINTOEOR(s) && s->s_rec_off == 0)
return (s->s_error = EDEADLK);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 9:46 PM (16 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17891331
Default Alt Text
D29544.diff (539 B)
Attached To
Mode
D29544: Make sbuf_drain safe for external use
Attached
Detach File
Event Timeline
Log In to Comment