--- linux/fs/pipe.c 2018/04/24 18:03:41 1.1.1.4 +++ linux/fs/pipe.c 2018/04/24 18:05:54 1.1.1.5 @@ -41,7 +41,7 @@ int pipe_read(struct inode * inode, stru put_fs_byte(((char *)inode->i_size)[size++],buf++); } wake_up(& PIPE_WRITE_WAIT(*inode)); - return read; + return read?read:-EAGAIN; } int pipe_write(struct inode * inode, struct file * filp, char * buf, int count)