patch-2.3.41 linux/drivers/sound/audio.c

Next file: linux/drivers/sound/cmpci.c
Previous file: linux/drivers/sound/ad1848.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.40/linux/drivers/sound/audio.c linux/drivers/sound/audio.c
@@ -228,7 +228,7 @@
 		{
 			    /* Handle nonblocking mode */
 			if ((file->f_flags & O_NONBLOCK) && err == -EAGAIN)
-				return p;	/* No more space. Return # of accepted bytes */
+				return p? p : -EAGAIN;	/* No more space. Return # of accepted bytes */
 			return err;
 		}
 		l = c;
@@ -308,11 +308,11 @@
 			 *	Nonblocking mode handling. Return current # of bytes
 			 */
 
-			if ((file->f_flags & O_NONBLOCK) && buf_no == -EAGAIN)
-				return p;
-
 			if (p > 0) 		/* Avoid throwing away data */
 				return p;	/* Return it instead */
+
+			if ((file->f_flags & O_NONBLOCK) && buf_no == -EAGAIN)
+				return -EAGAIN;
 
 			return buf_no;
 		}

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