@@ -437,8 +437,7 @@ static ssize_t hung_up_tty_read(struct file *file, char __user *buf,
437
437
return 0 ;
438
438
}
439
439
440
- static ssize_t hung_up_tty_write (struct file * file , const char __user * buf ,
441
- size_t count , loff_t * ppos )
440
+ static ssize_t hung_up_tty_write (struct kiocb * iocb , struct iov_iter * from )
442
441
{
443
442
return - EIO ;
444
443
}
@@ -504,7 +503,7 @@ static const struct file_operations console_fops = {
504
503
static const struct file_operations hung_up_tty_fops = {
505
504
.llseek = no_llseek ,
506
505
.read = hung_up_tty_read ,
507
- .write = hung_up_tty_write ,
506
+ .write_iter = hung_up_tty_write ,
508
507
.poll = hung_up_tty_poll ,
509
508
.unlocked_ioctl = hung_up_tty_ioctl ,
510
509
.compat_ioctl = hung_up_tty_compat_ioctl ,
@@ -1044,7 +1043,9 @@ static ssize_t tty_write(struct kiocb *iocb, struct iov_iter *from)
1044
1043
if (tty -> ops -> write_room == NULL )
1045
1044
tty_err (tty , "missing write_room method\n" );
1046
1045
ld = tty_ldisc_ref_wait (tty );
1047
- if (!ld || !ld -> ops -> write )
1046
+ if (!ld )
1047
+ return hung_up_tty_write (iocb , from );
1048
+ if (!ld -> ops -> write )
1048
1049
ret = - EIO ;
1049
1050
else
1050
1051
ret = do_tty_write (ld -> ops -> write , tty , file , from );
0 commit comments