summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-01-26 10:06:53 +0100
committerMarcel Holtmann <marcel@holtmann.org>2010-01-26 10:06:53 +0100
commite4850f2eeb0e4e137b2f9f7f3a63fdf4661fc498 (patch)
treeea22fc744e2a297bb2422d36b4464382c1587908 /src/main.c
parentb334372ef8a21c54695f80565ff2c27d92efb5f3 (diff)
downloadofono-e4850f2eeb0e4e137b2f9f7f3a63fdf4661fc498.tar.bz2
Add support for dynamic debug feature
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 3feea935..0fce3bdc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,9 +74,6 @@ static gboolean signal_cb(GIOChannel *channel, GIOCondition cond, gpointer data)
terminated++;
break;
- case SIGUSR2:
- __ofono_toggle_debug();
- break;
case SIGPIPE:
break;
default:
@@ -93,13 +90,13 @@ static void system_bus_disconnected(DBusConnection *conn, void *user_data)
g_main_loop_quit(event_loop);
}
-static gboolean option_debug = FALSE;
+static gchar *option_debug = NULL;
static gboolean option_detach = TRUE;
static gboolean option_version = FALSE;
static GOptionEntry options[] = {
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug,
- "Enable debug information output" },
+ { "debug", 'd', 0, G_OPTION_ARG_STRING, &option_debug,
+ "Specify debug options to enable", "DEBUG" },
{ "nodetach", 'n', G_OPTION_FLAG_REVERSE,
G_OPTION_ARG_NONE, &option_detach,
"Don't run as daemon in background" },
@@ -122,7 +119,6 @@ int main(int argc, char **argv)
sigemptyset(&mask);
sigaddset(&mask, SIGTERM);
sigaddset(&mask, SIGINT);
- sigaddset(&mask, SIGUSR2);
sigaddset(&mask, SIGPIPE);
if (sigprocmask(SIG_BLOCK, &mask, NULL) < 0) {
@@ -185,7 +181,7 @@ int main(int argc, char **argv)
}
#endif
- __ofono_log_init(option_detach, option_debug);
+ __ofono_log_init(option_debug, option_detach);
dbus_error_init(&error);