diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2012-02-02 18:09:27 +1100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2012-02-02 18:09:27 +1100 |
commit | ebcdb16862fb430eec590c13b84b03106725dd57 (patch) | |
tree | 8b7253804cb075bb969cdd5dca755ee26b01818d /tests/src/Xvnc.c | |
parent | 4f907a8f6ecf0f33a98c0eb6b86aecf39fc17fbf (diff) | |
download | lightdm-ebcdb16862fb430eec590c13b84b03106725dd57.tar.gz |
Allow child processes to be controlled by the test runner for greater control
Diffstat (limited to 'tests/src/Xvnc.c')
-rw-r--r-- | tests/src/Xvnc.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/tests/src/Xvnc.c b/tests/src/Xvnc.c index 2098b52a..144ea087 100644 --- a/tests/src/Xvnc.c +++ b/tests/src/Xvnc.c @@ -33,7 +33,7 @@ indicate_ready () handler = signal (SIGUSR1, SIG_IGN); if (handler == SIG_IGN) { - notify_status ("XSERVER :%d INDICATE-READY", display_number); + status_notify ("XSERVER :%d INDICATE-READY", display_number); kill (getppid (), SIGUSR1); } signal (SIGUSR1, handler); @@ -60,12 +60,12 @@ signal_cb (int signum) { if (signum == SIGHUP) { - notify_status ("XSERVER :%d DISCONNECT-CLIENTS", display_number); + status_notify ("XSERVER :%d DISCONNECT-CLIENTS", display_number); indicate_ready (); } else { - notify_status ("XSERVER :%d TERMINATE SIGNAL=%d", display_number, signum); + status_notify ("XSERVER :%d TERMINATE SIGNAL=%d", display_number, signum); quit (EXIT_SUCCESS); } } @@ -76,9 +76,9 @@ x_client_connect_cb (XClient *client, XConnect *message) gchar *auth_error = NULL; if (x_client_get_address (client)) - notify_status ("XSERVER :%d TCP-ACCEPT-CONNECT", display_number); + status_notify ("XSERVER :%d TCP-ACCEPT-CONNECT", display_number); else - notify_status ("XSERVER :%d ACCEPT-CONNECT", display_number); + status_notify ("XSERVER :%d ACCEPT-CONNECT", display_number); if (auth_path) { @@ -149,12 +149,17 @@ vnc_data_cb (GIOChannel *channel, GIOCondition condition, gpointer data) buffer[n_read] = '\0'; if (g_str_has_suffix (buffer, "\n")) buffer[n_read-1] = '\0'; - notify_status ("XSERVER :%d VNC-CLIENT-CONNECT VERSION=\"%s\"", display_number, buffer); + status_notify ("XSERVER :%d VNC-CLIENT-CONNECT VERSION=\"%s\"", display_number, buffer); } return TRUE; } +static void +request_cb (const gchar *message) +{ +} + int main (int argc, char **argv) { @@ -174,6 +179,10 @@ main (int argc, char **argv) g_type_init (); + loop = g_main_loop_new (NULL, FALSE); + + status_connect (request_cb); + for (i = 1; i < argc; i++) { char *arg = argv[i]; @@ -231,7 +240,7 @@ main (int argc, char **argv) x_server_set_listen_unix (xserver, listen_unix); x_server_set_listen_tcp (xserver, listen_tcp); - notify_status ("XSERVER :%d START GEOMETRY=%s DEPTH=%d", display_number, geometry, depth); + status_notify ("XSERVER :%d START GEOMETRY=%s DEPTH=%d", display_number, geometry, depth); config = g_key_file_new (); if (g_getenv ("LIGHTDM_TEST_CONFIG")) @@ -251,8 +260,6 @@ main (int argc, char **argv) return EXIT_FAILURE; } - loop = g_main_loop_new (NULL, FALSE); - lock_path = g_strdup_printf ("/tmp/.X%d-lock", display_number); lock_file = open (lock_path, O_CREAT | O_EXCL | O_WRONLY, 0444); if (lock_file < 0) |