patch-2.2.11 linux/fs/pipe.c

Next file: linux/fs/proc/array.c
Previous file: linux/fs/nfs/dir.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.10/linux/fs/pipe.c linux/fs/pipe.c
@@ -25,7 +25,7 @@
 /* Florian Coosmann (FGC)                                ^ current = 1       */
 /* Additionally, we now use locking technique. This prevents race condition  */
 /* in case of paging and multiple read/write on the same pipe. (FGC)         */
-
+/* Reads with count = 0 should always return 0. Julian Bradfield 1999-06-07. */
 
 static ssize_t pipe_read(struct file * filp, char * buf,
 			 size_t count, loff_t *ppos)
@@ -34,8 +34,11 @@
 	ssize_t chars = 0, size = 0, read = 0;
         char *pipebuf;
 
+
 	if (ppos != &filp->f_pos)
 		return -ESPIPE;
+
+	if ( !count ) return 0;
 
 	if (filp->f_flags & O_NONBLOCK) {
 		if (PIPE_LOCK(*inode))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)