patch-2.1.45 linux/drivers/char/n_tty.c

Next file: linux/drivers/char/pc110pad.c
Previous file: linux/drivers/char/misc.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
@@ -706,7 +706,7 @@
 		return;
 	
 	tty->icanon = (L_ICANON(tty) != 0);
-	if (tty->flags & (1<<TTY_HW_COOK_IN)) {
+	if (test_bit(TTY_HW_COOK_IN, &tty->flags)) {
 		tty->raw = 1;
 		tty->real_raw = 1;
 		return;
@@ -854,7 +854,7 @@
 	/* NOTE: not yet done after every sleep pending a thorough
 	   check of the logic of this change. -- jlc */
 	/* don't stop on /dev/console */
-	if (file->f_inode->i_rdev != CONSOLE_DEV &&
+	if (file->f_dentry->d_inode->i_rdev != CONSOLE_DEV &&
 	    current->tty == tty) {
 		if (tty->pgrp <= 0)
 			printk("read_chan: tty->pgrp <= 0!\n");
@@ -912,7 +912,7 @@
 			tty->minimum_to_wake = (minimum - (b - buf));
 		
 		if (!input_available_p(tty, 0)) {
-			if (tty->flags & (1 << TTY_OTHER_CLOSED)) {
+			if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
 				retval = -EIO;
 				break;
 			}
@@ -1013,7 +1013,7 @@
 	int retval = 0;
 
 	/* Job control check -- must be done at start (POSIX.1 7.1.1.4). */
-	if (L_TOSTOP(tty) && file->f_inode->i_rdev != CONSOLE_DEV) {
+	if (L_TOSTOP(tty) && file->f_dentry->d_inode->i_rdev != CONSOLE_DEV) {
 		retval = tty_check_change(tty);
 		if (retval)
 			return retval;
@@ -1030,7 +1030,7 @@
 			retval = -EIO;
 			break;
 		}
-		if (O_OPOST(tty) && !(tty->flags & (1<<TTY_HW_COOK_OUT))) {
+		if (O_OPOST(tty) && !(test_bit(TTY_HW_COOK_OUT, &tty->flags))) {
 			while (nr > 0) {
 				num = opost_block(tty, b, nr);
 				b += num;
@@ -1072,7 +1072,7 @@
 		mask |= POLLIN | POLLRDNORM;
 	if (tty->packet && tty->link->ctrl_status)
 		mask |= POLLPRI | POLLIN | POLLRDNORM;
-	if (tty->flags & (1 << TTY_OTHER_CLOSED))
+	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
 		mask |= POLLHUP;
 	if (tty_hung_up_p(file))
 		mask |= POLLHUP;

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