From: Tim Wiederhake Date: Wed, 19 Jan 2011 22:14:33 +0000 (+0100) Subject: close terminal window on exit X-Git-Tag: 0.85.0~643 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f71accc5b8b76281adff0edd98e3bceef02c660d;p=platform%2Fupstream%2Fweston.git close terminal window on exit --- diff --git a/clients/terminal.c b/clients/terminal.c index 1e015c1..78f575f 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -2268,6 +2268,9 @@ io_handler(GIOChannel *source, gsize bytes_read; GError *error = NULL; + if(condition == G_IO_HUP) + exit(0); + g_io_channel_read_chars(source, buffer, sizeof buffer, &bytes_read, &error); @@ -2298,8 +2301,8 @@ terminal_run(struct terminal *terminal, const char *path) terminal->master = master; terminal->channel = g_io_channel_unix_new(master); fcntl(master, F_SETFL, O_NONBLOCK); - g_io_add_watch(terminal->channel, G_IO_IN, - io_handler, terminal); + g_io_add_watch(terminal->channel, G_IO_IN, io_handler, terminal); + g_io_add_watch(terminal->channel, G_IO_HUP, io_handler, terminal); return 0; }