patch-2.1.4 linux/drivers/char/pty.c
Next file: linux/drivers/char/random.c
Previous file: linux/drivers/char/psaux.c
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Sun Oct 13 21:11:11 1996
- Orig file:
v2.1.3/linux/drivers/char/pty.c
- Orig date:
Wed Oct 9 08:55:19 1996
diff -u --recursive --new-file v2.1.3/linux/drivers/char/pty.c linux/drivers/char/pty.c
@@ -37,7 +37,7 @@
/*
* tmp_buf is used as a temporary buffer by pty_write. We need to
- * lock it in case the memcpy_fromfs blocks while swapping in a page,
+ * lock it in case the copy_from_user blocks while swapping in a page,
* and some other program tries to do a pty write at the same time.
* Since the lock will only come under contention when the system is
* swapping and available memory is low, it makes sense to share one
@@ -123,13 +123,9 @@
down(&tmp_buf_sem);
temp_buffer = tmp_buf +
((tty->driver.subtype-1) * PTY_BUF_SIZE);
- if (exception()) {
- up(&tmp_buf_sem);
- return -EFAULT;
- }
while (count > 0) {
n = MIN(count, PTY_BUF_SIZE);
- memcpy_fromfs(temp_buffer, buf, n);
+ copy_from_user(temp_buffer, buf, n);
r = to->ldisc.receive_room(to);
if (r <= 0)
break;
@@ -138,7 +134,6 @@
buf += n; c+= n;
count -= n;
}
- end_exception();
up(&tmp_buf_sem);
} else {
c = MIN(count, to->ldisc.receive_room(to));
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov