static gboolean replace_daemon_at (const gchar *directory) { g_free (control_directory); control_directory = g_strdup (directory); return gkd_control_quit (directory); }
static gboolean replace_daemon_at (const gchar *directory) { gboolean ret; /* * The first control_directory is the environment one, always * prefer that since it's the one that ssh will connect to */ if (control_directory == NULL) control_directory = g_strdup (directory); ret = gkd_control_quit (directory, GKD_CONTROL_QUIET_IF_NO_PEER); /* * If we quit, wait a short time before initializing so the other * daemon can quit completely */ if (ret == TRUE) g_usleep (200 * 1000); /* 200 ms in us */ /* * Note that we don't return TRUE, since we want to quit all the * running daemons (for this session) that may have been started * by dbus or elsewhere. */ return FALSE; }
int main (int argc, char *argv[]) { const char *directory; directory = g_getenv ("GNOME_KEYRING_CONTROL"); g_return_val_if_fail (directory, 1); if (!gkd_control_quit (directory, 0)) return 1; g_printerr ("success quitting daemon\n"); return 0; }