patch-2.3.50 linux/fs/pipe.c
Next file: linux/fs/proc/base.c
Previous file: linux/fs/ntfs/fs.c
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
Sun Mar 5 11:05:02 2000
- Orig file:
v2.3.49/linux/fs/pipe.c
- Orig date:
Sat Feb 26 22:31:54 2000
diff -u --recursive --new-file v2.3.49/linux/fs/pipe.c linux/fs/pipe.c
@@ -41,6 +41,7 @@
schedule();
remove_wait_queue(PIPE_WAIT(*inode), &wait);
current->state = TASK_RUNNING;
+ down(PIPE_SEM(*inode));
}
static ssize_t
@@ -81,9 +82,7 @@
PIPE_WAITING_READERS(*inode)--;
ret = -ERESTARTSYS;
if (signal_pending(current))
- goto out_nolock;
- if (down_interruptible(PIPE_SEM(*inode)))
- goto out_nolock;
+ goto out;
ret = 0;
if (!PIPE_EMPTY(*inode))
break;
@@ -162,7 +161,6 @@
if (down_interruptible(PIPE_SEM(*inode)))
goto out_nolock;
-do_more_write:
/* No readers yields SIGPIPE. */
if (!PIPE_READERS(*inode))
goto sigpipe;
@@ -182,9 +180,7 @@
PIPE_WAITING_WRITERS(*inode)--;
ret = -ERESTARTSYS;
if (signal_pending(current))
- goto out_nolock;
- if (down_interruptible(PIPE_SEM(*inode)))
- goto out_nolock;
+ goto out;
if (!PIPE_READERS(*inode))
goto sigpipe;
@@ -230,20 +226,13 @@
pipe_wait(inode);
PIPE_WAITING_WRITERS(*inode)--;
if (signal_pending(current))
- goto out_nolock;
- if (down_interruptible(PIPE_SEM(*inode)))
- goto out_nolock;
+ goto out;
if (!PIPE_READERS(*inode))
goto sigpipe;
} while (!PIPE_FREE(*inode));
ret = -EFAULT;
}
- if (count && PIPE_WAITING_READERS(*inode) &&
- !(filp->f_flags & O_NONBLOCK)) {
- wake_up_interruptible_sync(PIPE_WAIT(*inode));
- goto do_more_write;
- }
/* Signal readers asynchronously that there is more data. */
wake_up_interruptible(PIPE_WAIT(*inode));
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)