summaryrefslogtreecommitdiff
path: root/daemon/session-worker-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/session-worker-main.c')
-rw-r--r--daemon/session-worker-main.c182
1 files changed, 91 insertions, 91 deletions
diff --git a/daemon/session-worker-main.c b/daemon/session-worker-main.c
index d435faa2..2a52e03c 100644
--- a/daemon/session-worker-main.c
+++ b/daemon/session-worker-main.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
*
@@ -48,133 +48,133 @@
static gboolean
signal_cb (int signo,
- gpointer data)
+ gpointer data)
{
- int ret;
+ int ret;
- g_debug ("Got callback for signal %d", signo);
+ g_debug ("Got callback for signal %d", signo);
- ret = TRUE;
+ ret = TRUE;
- switch (signo) {
- case SIGSEGV:
- case SIGBUS:
- case SIGILL:
- case SIGABRT:
- g_debug ("Caught signal %d.", signo);
+ switch (signo) {
+ case SIGSEGV:
+ case SIGBUS:
+ case SIGILL:
+ case SIGABRT:
+ g_debug ("Caught signal %d.", signo);
- ret = FALSE;
- break;
+ ret = FALSE;
+ break;
- case SIGFPE:
- case SIGPIPE:
- /* let the fatal signals interrupt us */
- g_debug ("Caught signal %d, shutting down abnormally.", signo);
- ret = FALSE;
+ case SIGFPE:
+ case SIGPIPE:
+ /* let the fatal signals interrupt us */
+ g_debug ("Caught signal %d, shutting down abnormally.", signo);
+ ret = FALSE;
- break;
+ break;
- case SIGINT:
- case SIGTERM:
- /* let the fatal signals interrupt us */
- g_debug ("Caught signal %d, shutting down normally.", signo);
- ret = FALSE;
+ case SIGINT:
+ case SIGTERM:
+ /* let the fatal signals interrupt us */
+ g_debug ("Caught signal %d, shutting down normally.", signo);
+ ret = FALSE;
- break;
+ break;
- case SIGHUP:
- g_debug ("Got HUP signal");
- /* FIXME:
- * Reread config stuff like system config files, VPN service files, etc
- */
- ret = TRUE;
+ case SIGHUP:
+ g_debug ("Got HUP signal");
+ /* FIXME:
+ * Reread config stuff like system config files, VPN service files, etc
+ */
+ ret = TRUE;
- break;
+ break;
- case SIGUSR1:
- g_debug ("Got USR1 signal");
- /* FIXME:
- * Play with log levels or something
- */
- ret = TRUE;
+ case SIGUSR1:
+ g_debug ("Got USR1 signal");
+ /* FIXME:
+ * Play with log levels or something
+ */
+ ret = TRUE;
- break;
+ break;
- default:
- g_debug ("Caught unhandled signal %d", signo);
- ret = TRUE;
+ default:
+ g_debug ("Caught unhandled signal %d", signo);
+ ret = TRUE;
- break;
- }
+ break;
+ }
- return ret;
+ return ret;
}
int
main (int argc,
char **argv)
{
- GMainLoop *main_loop;
- GOptionContext *context;
- GdmSessionWorker *worker;
- GdmSignalHandler *signal_handler;
- const char *address;
- static GOptionEntry entries [] = {
- { NULL }
- };
+ GMainLoop *main_loop;
+ GOptionContext *context;
+ GdmSessionWorker *worker;
+ GdmSignalHandler *signal_handler;
+ const char *address;
+ static GOptionEntry entries [] = {
+ { NULL }
+ };
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- textdomain (GETTEXT_PACKAGE);
- setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+ setlocale (LC_ALL, "");
- g_type_init ();
+ g_type_init ();
- context = g_option_context_new (_("GNOME Display Manager Session Worker"));
- g_option_context_add_main_entries (context, entries, NULL);
+ context = g_option_context_new (_("GNOME Display Manager Session Worker"));
+ g_option_context_add_main_entries (context, entries, NULL);
- g_option_context_parse (context, &argc, &argv, NULL);
- g_option_context_free (context);
+ g_option_context_parse (context, &argc, &argv, NULL);
+ g_option_context_free (context);
- gdm_log_init ();
- gdm_log_set_debug (TRUE);
+ gdm_log_init ();
+ gdm_log_set_debug (TRUE);
- address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
- if (address == NULL) {
- g_warning ("GDM_SESSION_DBUS_ADDRESS not set");
- exit (1);
- }
+ address = g_getenv ("GDM_SESSION_DBUS_ADDRESS");
+ if (address == NULL) {
+ g_warning ("GDM_SESSION_DBUS_ADDRESS not set");
+ exit (1);
+ }
- worker = gdm_session_worker_new (address);
+ worker = gdm_session_worker_new (address);
- main_loop = g_main_loop_new (NULL, FALSE);
+ main_loop = g_main_loop_new (NULL, FALSE);
- signal_handler = gdm_signal_handler_new ();
- gdm_signal_handler_set_main_loop (signal_handler, main_loop);
- gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGBUS, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGFPE, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGHUP, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
- gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
+ signal_handler = gdm_signal_handler_new ();
+ gdm_signal_handler_set_main_loop (signal_handler, main_loop);
+ gdm_signal_handler_add (signal_handler, SIGTERM, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGINT, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGILL, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGBUS, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGFPE, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGHUP, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGSEGV, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGABRT, signal_cb, NULL);
+ gdm_signal_handler_add (signal_handler, SIGUSR1, signal_cb, NULL);
- g_main_loop_run (main_loop);
+ g_main_loop_run (main_loop);
- if (worker != NULL) {
- g_object_unref (worker);
- }
+ if (worker != NULL) {
+ g_object_unref (worker);
+ }
- if (signal_handler != NULL) {
- g_object_unref (signal_handler);
- }
+ if (signal_handler != NULL) {
+ g_object_unref (signal_handler);
+ }
- g_main_loop_unref (main_loop);
+ g_main_loop_unref (main_loop);
out:
- g_debug ("Worker finished");
+ g_debug ("Worker finished");
- return 0;
+ return 0;
}