diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 55 |
1 files changed, 28 insertions, 27 deletions
@@ -40,9 +40,9 @@ #define NAME_TO_CLAIM "org.freedesktop.Accounts" static gboolean -ensure_directory (const char *path, - gint mode, - GError **error) +ensure_directory (const char *path, + gint mode, + GError **error) { GStatBuf stat_buffer = { 0 }; @@ -81,9 +81,9 @@ ensure_directory (const char *path, } static gboolean -ensure_file_permissions (const char *dir_path, - gint file_mode, - GError **error) +ensure_file_permissions (const char *dir_path, + gint file_mode, + GError **error) { GDir *dir = NULL; const gchar *filename; @@ -126,13 +126,14 @@ ensure_file_permissions (const char *dir_path, } static void -on_bus_acquired (GDBusConnection *connection, - const gchar *name, - gpointer user_data) +on_bus_acquired (GDBusConnection *connection, + const gchar *name, + gpointer user_data) { GMainLoop *loop = user_data; Daemon *daemon; - g_autoptr(GError) error = NULL; + + g_autoptr (GError) error = NULL; if (!ensure_directory (get_icondir (), 0775, &error) || !ensure_directory (get_userdir (), 0700, &error) || @@ -155,9 +156,9 @@ on_bus_acquired (GDBusConnection *connection, } static void -on_name_lost (GDBusConnection *connection, - const gchar *name, - gpointer user_data) +on_name_lost (GDBusConnection *connection, + const gchar *name, + gpointer user_data) { GMainLoop *loop = user_data; @@ -168,12 +169,12 @@ on_name_lost (GDBusConnection *connection, static gboolean debug; static void -on_log_debug (const gchar *log_domain, +on_log_debug (const gchar *log_domain, GLogLevelFlags log_level, - const gchar *message, - gpointer user_data) + const gchar *message, + gpointer user_data) { - g_autoptr(GString) string = NULL; + g_autoptr (GString) string = NULL; const gchar *progname; int ret G_GNUC_UNUSED; @@ -181,7 +182,7 @@ on_log_debug (const gchar *log_domain, progname = g_get_prgname (); g_string_append_printf (string, "(%s:%lu): %s%sDEBUG: %s\n", - progname ? progname : "process", (gulong)getpid (), + progname ? progname : "process", (gulong) getpid (), log_domain ? log_domain : "", log_domain ? "-" : "", message ? message : "(NULL) message"); @@ -211,18 +212,19 @@ on_signal_quit (gpointer data) } int -main (int argc, char *argv[]) +main (int argc, + char *argv[]) { - g_autoptr(GMainLoop) loop = NULL; - g_autoptr(GError) error = NULL; + g_autoptr (GMainLoop) loop = NULL; + g_autoptr (GError) error = NULL; GBusNameOwnerFlags flags; - g_autoptr(GOptionContext) context = NULL; + g_autoptr (GOptionContext) context = NULL; static gboolean replace; static gboolean show_version; static GOptionEntry entries[] = { - { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_("Output version information and exit"), NULL }, - { "replace", 0, 0, G_OPTION_ARG_NONE, &replace, N_("Replace existing instance"), NULL }, - { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable debugging code"), NULL }, + { "version", 0, 0, G_OPTION_ARG_NONE, &show_version, N_ ("Output version information and exit"), NULL }, + { "replace", 0, 0, G_OPTION_ARG_NONE, &replace, N_ ("Replace existing instance"), NULL }, + { "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_ ("Enable debugging code"), NULL }, { NULL } }; @@ -241,7 +243,7 @@ main (int argc, char *argv[]) context = g_option_context_new (NULL); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); - g_option_context_set_summary (context, _("Provides D-Bus interfaces for querying and manipulating\nuser account information.")); + g_option_context_set_summary (context, _ ("Provides D-Bus interfaces for querying and manipulating\nuser account information.")); g_option_context_add_main_entries (context, entries, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_warning ("%s", error->message); @@ -286,4 +288,3 @@ main (int argc, char *argv[]) return EXIT_SUCCESS; } - |