Page MenuHomeFreeBSD

D22261.diff
No OneTemporary

D22261.diff

Index: head/sys/kern/sys_pipe.c
===================================================================
--- head/sys/kern/sys_pipe.c
+++ head/sys/kern/sys_pipe.c
@@ -970,15 +970,8 @@
goto error1;
}
- while (wpipe->pipe_map.cnt != 0) {
- if (wpipe->pipe_state & PIPE_EOF) {
- wpipe->pipe_map.cnt = 0;
- pipe_destroy_write_buffer(wpipe);
- pipeselwakeup(wpipe);
- pipeunlock(wpipe);
- error = EPIPE;
- goto error1;
- }
+ while (wpipe->pipe_map.cnt != 0 &&
+ (wpipe->pipe_state & PIPE_EOF) == 0) {
if (wpipe->pipe_state & PIPE_WANTR) {
wpipe->pipe_state &= ~PIPE_WANTR;
wakeup(wpipe);
@@ -993,12 +986,16 @@
break;
}
- if (wpipe->pipe_state & PIPE_EOF)
+ if ((wpipe->pipe_state & PIPE_EOF) != 0) {
+ wpipe->pipe_map.cnt = 0;
+ pipe_destroy_write_buffer(wpipe);
+ pipeselwakeup(wpipe);
error = EPIPE;
- if (error == EINTR || error == ERESTART)
+ } else if (error == EINTR || error == ERESTART) {
pipe_clone_write_buffer(wpipe);
- else
+ } else {
pipe_destroy_write_buffer(wpipe);
+ }
pipeunlock(wpipe);
KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0,
("pipe %p leaked PIPE_DIRECTW", wpipe));

File Metadata

Mime Type
text/plain
Expires
Tue, Aug 25, 8:51 PM (15 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37251108
Default Alt Text
D22261.diff (1 KB)

Event Timeline