patch-2.1.20 linux/fs/pipe.c

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

diff -u --recursive --new-file v2.1.19/linux/fs/pipe.c linux/fs/pipe.c
@@ -18,7 +18,11 @@
  * Define this if you want SunOS compatibility wrt braindead
  * select behaviour on FIFO's.
  */
+#ifdef __sparc__
+#define FIFO_SUNOS_BRAINDAMAGE
+#else
 #undef FIFO_SUNOS_BRAINDAMAGE
+#endif
 
 /* We don't use the head/tail construction any more. Now we use the start/len*/
 /* construction providing full use of PIPE_BUF (multiple of PAGE_SIZE) */
@@ -147,14 +151,9 @@
 static int pipe_ioctl(struct inode *pino, struct file * filp,
 	unsigned int cmd, unsigned long arg)
 {
-	int error;
-
 	switch (cmd) {
 		case FIONREAD:
-			error = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int));
-			if (!error)
-				put_user(PIPE_SIZE(*pino),(int *) arg);
-			return error;
+			return put_user(PIPE_SIZE(*pino),(int *) arg);
 		default:
 			return -EINVAL;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov