summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2012-01-13 12:53:46 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-01-24 15:04:06 +0100
commit6ebc7c18920384be8e66021b2ea93db1a1c9f5be (patch)
treea2253f047bb30b9ffb0db9f466325e0e234e80ad /tests
parentc63a5f2b954aac958d50adee027e25aad241e34a (diff)
terminal: use new pty object
Add a new terminal_open/terminal_close methods to correspond to the pty ones, and notify when the terminal is closed. Signed-off-by: Ran Benita <ran234@gmail.com> Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_terminal.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_terminal.c b/tests/test_terminal.c
index ae4cc39..186f888 100644
--- a/tests/test_terminal.c
+++ b/tests/test_terminal.c
@@ -63,6 +63,15 @@ static void sig_term(struct kmscon_signal *sig, int signum, void *data)
terminate = 1;
}
+static void terminal_closed(struct kmscon_terminal *term, void *data)
+{
+ /*
+ * Alternativly, we could spwan a new login/shell here, like what
+ * happens when the user exits the shell in a linux console.
+ */
+ terminate = 1;
+}
+
static void read_input(struct kmscon_input *input,
struct kmscon_input_event *ev, void *data)
{
@@ -186,7 +195,8 @@ static int setup_app(struct app *app)
if (ret)
goto err_loop;
- ret = kmscon_terminal_connect_eloop(app->term, app->eloop);
+ ret = kmscon_terminal_open(app->term, app->eloop,
+ terminal_closed, NULL);
if (ret)
goto err_loop;