Skip to content

Commit

Permalink
vcs: invoke the vt update callback when /dev/vcs* is written to
Browse files Browse the repository at this point in the history
A notifier chain is called whenever the vt code modifies a terminal
content, except for one case which is when the modification comes
through writes to /dev/vcs* devices.  Let's add the missing notifier
invocation at the end of vcs_write() for that case too.

Signed-off-by: Nicolas Pitre <[email protected]>
Cc: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
npitre authored and gregkh committed Oct 22, 2010
1 parent 47725ac commit 432c9ed
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/char/vc_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,8 @@ vcs_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
}
*ppos += written;
ret = written;
if (written)
vcs_scr_updated(vc);

unlock_out:
release_console_sem();
Expand Down
5 changes: 5 additions & 0 deletions drivers/char/vt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4182,6 +4182,11 @@ void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org)
}
}

void vcs_scr_updated(struct vc_data *vc)
{
notify_update(vc);
}

/*
* Visible symbols for modules
*/
Expand Down
1 change: 1 addition & 0 deletions include/linux/selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ extern void putconsxy(struct vc_data *vc, unsigned char *p);

extern u16 vcs_scr_readw(struct vc_data *vc, const u16 *org);
extern void vcs_scr_writew(struct vc_data *vc, u16 val, u16 *org);
extern void vcs_scr_updated(struct vc_data *vc);

#endif

0 comments on commit 432c9ed

Please sign in to comment.