diff options
author | Eric Koegel <eric.koegel@gmail.com> | 2015-06-07 17:36:38 +0300 |
---|---|---|
committer | Eric Koegel <eric.koegel@gmail.com> | 2015-06-07 17:36:38 +0300 |
commit | b37c042c56a6ed085127eda2dcabd0b489ff5a26 (patch) | |
tree | 1b48d4038be08801c24351fb8b423a0179775406 | |
parent | 777500a6f5b6ae2bde22df00e16ae97e0e73264d (diff) | |
download | ConsoleKit2-b37c042c56a6ed085127eda2dcabd0b489ff5a26.tar.gz |
Don't delete the inhibit files on startup
There's no gain since they are randomly generated temp files.
-rw-r--r-- | src/main.c | 39 |
1 files changed, 0 insertions, 39 deletions
@@ -97,45 +97,8 @@ delete_pid (void) } static void -delete_inhibit_files (void) -{ - GDir *dir; - GError *error = NULL; - const gchar *INHIBIT_DIRECTORY = RUNDIR "/ConsoleKit/inhibit"; - const gchar *name; - - g_debug ("Cleaning up %s", INHIBIT_DIRECTORY); - - dir = g_dir_open (INHIBIT_DIRECTORY, 0, &error); - if (dir == NULL) { - g_debug ("Couldn't open directory %s: %s", INHIBIT_DIRECTORY, - error->message); - g_error_free (error); - return; - } - while ((name = g_dir_read_name (dir)) != NULL) { - gchar *file; - - /* the inhibit files end in .pipe */ - if (!g_str_has_suffix (name, ".pipe")) { - continue; - } - - file = g_build_filename (INHIBIT_DIRECTORY, name, NULL); - - g_debug ("Removing inhibit file: %s", file); - if (unlink (file) == -1) { - g_warning ("Couldn't delete inhibit file: %s", file); - } - g_free (file); - } - g_dir_close (dir); -} - -static void cleanup (void) { - delete_inhibit_files (); delete_pid (); } @@ -329,8 +292,6 @@ main (int argc, bus_acquired, name_acquired, name_lost, NULL, NULL); - delete_inhibit_files (); - create_pid_file (); loop = g_main_loop_new (NULL, FALSE); |