patch-2.3.10 linux/fs/pipe.c

Next file: linux/fs/proc/fd.c
Previous file: linux/fs/open.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.9/linux/fs/pipe.c linux/fs/pipe.c
@@ -27,7 +27,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 do_pipe_read(struct file * filp, char * buf, size_t count)
 {
@@ -144,9 +144,12 @@
 {
 	ssize_t retval;
 
+
 	if (ppos != &filp->f_pos)
 		return -ESPIPE;
 
+	if ( !count ) return 0;
+
 	lock_kernel();
 	retval = do_pipe_read(filp, buf, count);
 	unlock_kernel();
@@ -480,6 +483,7 @@
 	NULL,			/* mknod */
 	NULL,			/* rename */
 	NULL,			/* readlink */
+	NULL,			/* follow_link */
 	NULL,			/* get_block */
 	NULL,			/* readpage */
 	NULL,			/* writepage */

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