diff options
author | Richard Hughes <richard@hughsie.com> | 2010-06-05 15:55:29 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2010-06-05 15:55:29 +0100 |
commit | 82a6a882d03c145625edbe23dade65bc14f85e73 (patch) | |
tree | aa4585bd7d72bb45bc83528933ff8e624c5877f0 /src/up-main.c | |
parent | 2aba7d4cfbad7f04934be455317ddfd64689e3c1 (diff) |
Assign names to our idle sources when using new versions of glib2
This makes it possible to profile more accurately using systemtap
Diffstat (limited to 'src/up-main.c')
-rw-r--r-- | src/up-main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/up-main.c b/src/up-main.c index 493de25..281ea28 100644 --- a/src/up-main.c +++ b/src/up-main.c @@ -133,6 +133,7 @@ main (gint argc, gchar **argv) gint retval = 1; gboolean timed_exit = FALSE; gboolean immediate_exit = FALSE; + guint timer_id = 0; const GOptionEntry options[] = { { "timed-exit", '\0', 0, G_OPTION_ARG_NONE, &timed_exit, @@ -191,8 +192,12 @@ main (gint argc, gchar **argv) } /* only timeout and close the mainloop if we have specified it on the command line */ - if (timed_exit) - g_timeout_add_seconds (30, (GSourceFunc) up_main_timed_exit_cb, loop); + if (timed_exit) { + timer_id = g_timeout_add_seconds (30, (GSourceFunc) up_main_timed_exit_cb, loop); +#if GLIB_CHECK_VERSION(2,25,8) + g_source_set_name_by_id (timer_id, "[UpMain] idle"); +#endif + } /* immediatly exit */ if (immediate_exit) |