rpms/imsettings/devel imsettings-unref-later.patch, NONE, 1.1 imsettings.spec, 1.39, 1.40

Akira TAGOH tagoh at fedoraproject.org
Fri Sep 11 07:23:39 UTC 2009


Author: tagoh

Update of /cvs/pkgs/rpms/imsettings/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv3897

Modified Files:
	imsettings.spec 
Added Files:
	imsettings-unref-later.patch 
Log Message:
* Fri Sep 11 2009 Akira TAGOH <tagoh at redhat.com> - 0.107.3-3
- Fix keeping IM process running as the defunct process. (#522689)

imsettings-unref-later.patch:
 factory.c |   51 +++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 47 insertions(+), 4 deletions(-)

--- NEW FILE imsettings-unref-later.patch ---
2009-09-11  Akira TAGOH  <tagoh at redhat.com>
 
	* src/factory.c (_get_process_info_by_pid): new.
	(_watch_im_status_cb): unref'd the instance here to not keep
	the process running as zombie. (rhbz#522689)
	(_stop_process): don't remove the instance from the hash table yet.

Index: src/factory.c
===================================================================
--- src/factory.c	(リビジョン 340)
+++ src/factory.c	(リビジョン 341)
@@ -214,6 +214,25 @@
 	return NULL;
 }
 
+static struct ProcessInformation *
+_get_process_info_by_pid(GHashTable *table,
+			 GPid        pid)
+{
+	GHashTableIter iter;
+	gpointer key, val;
+
+	g_hash_table_iter_init(&iter, table);
+	while (g_hash_table_iter_next(&iter, &key, &val)) {
+		struct ProcessInformation *info = val;
+
+		if (pid == info->pid) {
+			return info;
+		}
+	}
+
+	return NULL;
+}
+
 static GPid
 _get_pid_from_name(IMSettingsManagerPrivate *priv,
 		   gboolean                  is_body,
@@ -462,8 +481,25 @@
 			}
 		}
 	} else {
-		g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO,
-		      "pid %d is successfully stopped with %s.", pid, status_message->str);
+		info = _get_process_info_by_pid(priv->body2info, pid);
+		if (info == NULL) {
+			is_body = FALSE;
+			info = _get_process_info_by_pid(priv->aux2info, pid);
+		}
+		if (info == NULL) {
+			g_warning("No consistency in the internal process management database: pid: %d", pid);
+			g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO,
+			      "pid %d is successfully stopped with %s.", pid, status_message->str);
+		} else {
+			gchar *module = g_strdup(info->module);
+
+			g_hash_table_remove(is_body ? priv->body2info : priv->aux2info,
+					    info->module);
+			g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO,
+			      "Stopped %s process for %s with %s: pid %d",
+			      is_body ? "Main" : "AUX", module, status_message->str, pid);
+			g_free(module);
+		}
 	}
 	if (status_message)
 		g_string_free(status_message, TRUE);
@@ -635,7 +671,7 @@
 		}
 	} else {
 		tmp = _process_info_ref(info);
-		g_hash_table_remove(hash, identity);
+		/* info will be deleted from *2info Hash table at _watch_im_status_cb when the process is really died. */
 		g_hash_table_remove(priv->pid2id, GINT_TO_POINTER (info->pid));
 		if (kill(-info->pid, SIGTERM) == -1) {
 			gchar *module = g_strdup(identity);
@@ -647,8 +683,15 @@
 			g_hash_table_insert(hash, module, tmp);
 			g_hash_table_insert(priv->pid2id, GINT_TO_POINTER (info->pid), GUINT_TO_POINTER (info->id));
 		} else {
+			GTimeVal time;
+			gchar *s;
+
+			g_get_current_time(&time);
+			s = g_time_val_to_iso8601(&time);
+			g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "Sent a signal to stop %s: pid: %d, time: %s", identity, info->pid, s);
 			retval = TRUE;
-			_process_info_unref(tmp);
+			g_free(s);
+			/* info will be unref'd in _watch_im_status_cb when the process is really died. */
 		}
 	}
 


Index: imsettings.spec
===================================================================
RCS file: /cvs/pkgs/rpms/imsettings/devel/imsettings.spec,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -p -r1.39 -r1.40
--- imsettings.spec	8 Sep 2009 04:28:35 -0000	1.39
+++ imsettings.spec	11 Sep 2009 07:23:39 -0000	1.40
@@ -1,6 +1,6 @@
 Name:		imsettings
 Version:	0.107.3
-Release:	2%{?dist}
+Release:	3%{?dist}
 License:	LGPLv2+
 URL:		http://code.google.com/p/imsettings/
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -19,6 +19,7 @@ Source1: 	imsettings-kde.sh
 Patch0:		imsettings-constraint-of-language.patch
 Patch1:		imsettings-disable-xim.patch
 Patch2:		imsettings-unref-notify.patch
+Patch3:		imsettings-unref-later.patch
 
 Summary:	Delivery framework for general Input Method configuration
 Group:		Applications/System
@@ -88,6 +89,7 @@ This package contains a plugin to get th
 %patch0 -p1 -b .0-lang
 %patch1 -p1 -b .1-xim
 %patch2 -p0 -b .2-unref
+%patch3 -p0 -b .3-zombie
 
 %build
 %configure	\
@@ -213,6 +215,9 @@ fi
 
 
 %changelog
+* Fri Sep 11 2009 Akira TAGOH <tagoh at redhat.com> - 0.107.3-3
+- Fix keeping IM process running as the defunct process. (#522689)
+
 * Tue Sep  8 2009 Akira TAGOH <tagoh at redhat.com> - 0.107.3-2
 - Fix aborting after dbus session closed. (#520976)
 




More information about the fedora-extras-commits mailing list