public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in sys-power/thermald/files: thermald-1.4.2-terminate-r1.patch thermald-1.4.2-terminate.patch
@ 2015-07-15  4:20 Yixun Lan (dlan)
  0 siblings, 0 replies; only message in thread
From: Yixun Lan (dlan) @ 2015-07-15  4:20 UTC (permalink / raw
  To: gentoo-commits

dlan        15/07/15 04:20:40

  Added:                thermald-1.4.2-terminate-r1.patch
  Removed:              thermald-1.4.2-terminate.patch
  Log:
  update patch from upstream
  
  (Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0xAABEFD55)

Revision  Changes    Path
1.1                  sys-power/thermald/files/thermald-1.4.2-terminate-r1.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/thermald/files/thermald-1.4.2-terminate-r1.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-power/thermald/files/thermald-1.4.2-terminate-r1.patch?rev=1.1&content-type=text/plain

Index: thermald-1.4.2-terminate-r1.patch
===================================================================
commit 14bf458675a735975c6b9bf7394682e93398a8e0
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Tue Jul 14 17:46:45 2015 -0700

    Fix regression in exit via dbus message
    
    Terminate via dbus terminate message is broken. Fixed this.
    Thanks to Yixun Lan <yixun.lan@gmail.com> for finding this.

diff --git a/src/main.cpp b/src/main.cpp
index 2cf4864..d692cf3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -50,7 +50,7 @@
 #define TD_DIST_VERSION PACKAGE_VERSION
 #endif
 
-extern int thd_dbus_server_init();
+extern int thd_dbus_server_init(void (*exit_handler)(int));
 
 // Default log level
 static int thd_log_level = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL
@@ -263,7 +263,7 @@ int main(int argc, char *argv[]) {
 	}
 
 	if (dbus_enable)
-		thd_dbus_server_init();
+		thd_dbus_server_init(sig_int_handler);
 
 	if (!no_daemon) {
 		printf("Ready to serve requests: Daemonizing.. %d\n", thd_daemonize);
diff --git a/src/thd_dbus_interface.cpp b/src/thd_dbus_interface.cpp
index 021bce2..7926101 100644
--- a/src/thd_dbus_interface.cpp
+++ b/src/thd_dbus_interface.cpp
@@ -187,8 +187,12 @@ gboolean thd_dbus_interface_get_current_preference(PrefObject *obj,
 	return TRUE;
 }
 
+void (*thd_dbus_exit_callback)(int);
 gboolean thd_dbus_interface_terminate(PrefObject *obj, GError **error) {
 	thd_engine->thd_engine_terminate();
+	if (thd_dbus_exit_callback)
+		thd_dbus_exit_callback(0);
+
 	return TRUE;
 }
 
@@ -561,13 +565,15 @@ gboolean thd_dbus_interface_get_sensor_temperature(PrefObject *obj, int index,
 }
 
 // Setup dbus server
-int thd_dbus_server_init() {
+int thd_dbus_server_init(void (*exit_handler)(int)) {
 	DBusGConnection *bus;
 	DBusGProxy *bus_proxy;
 	GError *error = NULL;
 	guint result;
 	PrefObject *value_obj;
 
+	thd_dbus_exit_callback = exit_handler;
+
 	bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
 	if (error != NULL) {
 		thd_log_error("Couldn't connect to session bus: %s:\n", error->message);





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-07-15  4:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-15  4:20 [gentoo-commits] gentoo-x86 commit in sys-power/thermald/files: thermald-1.4.2-terminate-r1.patch thermald-1.4.2-terminate.patch Yixun Lan (dlan)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox