[PATCH] fix tty_destroy

Kristian Høgsberg krh at bitplanet.net
Tue Jan 25 05:42:47 PST 2011


On Tue, Jan 25, 2011 at 6:01 AM, Tim Wiederhake <twied at gmx.net> wrote:
> fixes segfault when active tty could not be opened
> fixes copy-paste mistake.

Thanks, applied.  A little nitpick about the commit message
formatting: could you capitalize the title and format the body as
regular text (regular punctuation and capitalize first word in
sentences).

Kristian

> ---
>  compositor/tty.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/compositor/tty.c b/compositor/tty.c
> index 70c319d..6314b14 100644
> --- a/compositor/tty.c
> +++ b/compositor/tty.c
> @@ -148,12 +148,12 @@ tty_create(struct wlsc_compositor *compositor)
>  void
>  tty_destroy(struct tty *tty)
>  {
> -       int ret;
> +        if(!tty)
> +                return;
>
> -       ret = ioctl(tty->fd, KDSETMODE, KD_TEXT);
> -       if (ret)
> +       if (ioctl(tty->fd, KDSETMODE, KD_TEXT))
>                fprintf(stderr,
> -                       "failed to set KD_GRAPHICS mode on tty: %m\n");
> +                       "failed to set KD_TEXT mode on tty: %m\n");
>
>        if (tcsetattr(tty->fd, TCSANOW, &tty->terminal_attributes) < 0)
>                fprintf(stderr,
> --
> 1.7.2.3
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


More information about the wayland-devel mailing list