[seahorse-plugins] Bug 579738 – seahorse-agent leaves behind its socket dir
- From: Adam Schreiber <sadam src gnome org>
- To: svn-commits-list gnome org
- Subject: [seahorse-plugins] Bug 579738 – seahorse-agent leaves behind its socket dir
- Date: Wed, 22 Apr 2009 16:42:15 -0400 (EDT)
commit 02140f48f3532e1a896a56fbab1f7935f8041c48
Author: Adam Schreiber <sadam gnome org>
Date: Wed Apr 22 16:41:11 2009 -0400
Bug 579738 â?? seahorse-agent leaves behind its socket dir
Add an atexit() handler after forking the child process.
---
agent/seahorse-agent-main.c | 4 +++-
agent/seahorse-agent.c | 5 +++++
agent/seahorse-agent.h | 1 +
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/agent/seahorse-agent-main.c b/agent/seahorse-agent-main.c
index 0b46542..5f7c95e 100644
--- a/agent/seahorse-agent-main.c
+++ b/agent/seahorse-agent-main.c
@@ -240,7 +240,7 @@ int main(int argc, char* argv[])
gtk_init_with_args (&argc, &argv, _("Encryption Key Agent (Seahorse)"), (GOptionEntry *) options, GETTEXT_PACKAGE, NULL);
gtk_quit_add (0, (GtkFunction) seahorse_agent_uninit, NULL);
-
+
seahorse_agent_prefork ();
if (seahorse_agent_execvars &&
@@ -253,6 +253,8 @@ int main(int argc, char* argv[])
*/
daemonize (seahorse_agent_execvars ? agent_exec_args : NULL);
+ atexit (seahorse_agent_exit);
+
g_strfreev (agent_exec_args);
agent_exec_args = NULL;
diff --git a/agent/seahorse-agent.c b/agent/seahorse-agent.c
index 2224d33..b2a6f6d 100644
--- a/agent/seahorse-agent.c
+++ b/agent/seahorse-agent.c
@@ -161,3 +161,8 @@ seahorse_agent_uninit (gpointer *data)
return FALSE;
}
+void
+seahorse_agent_exit ()
+{
+ seahorse_agent_uninit (NULL);
+}
diff --git a/agent/seahorse-agent.h b/agent/seahorse-agent.h
index faeb152..92267a9 100644
--- a/agent/seahorse-agent.h
+++ b/agent/seahorse-agent.h
@@ -55,6 +55,7 @@ void seahorse_agent_childsetup ();
/* Called in the new child process */
gboolean seahorse_agent_init ();
gboolean seahorse_agent_uninit (gpointer *data);
+void seahorse_agent_exit ();
/* Global options to set from the command line */
extern gboolean seahorse_agent_cshell;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]