hal: Branch 'master' - 3 commits
Holger Macht
homac at kemper.freedesktop.org
Tue Jan 9 00:19:44 PST 2007
hald/linux/addons/addon-cpufreq.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
New commits:
diff-tree 812a2e90f4e7c632829228ddf6460281fad2b964 (from parents)
Merge: 99d84acb3056e5e15b25c1c8c118a8fa865d88e4 cabf4cee0c6d464c009e67c032ec93492245cfe7
Author: Holger Macht <holger at homac.de>
Date: Tue Jan 9 09:04:18 2007 +0100
Merge branch 'master' of git+ssh://homac@git.freedesktop.org/git/hal
diff-tree 99d84acb3056e5e15b25c1c8c118a8fa865d88e4 (from a22c4dcaa0b9f53c43f4510bf4033edeec0f5115)
Author: Holger Macht <holger at homac.de>
Date: Fri Dec 15 13:58:18 2006 +0100
throw exception if D-Bus connection of sender is NULL
In certain circumstances, dbus_message_get_sender(message)
might return NULL. Care about the error and throw exception.
diff --git a/hald/linux/addons/addon-cpufreq.c b/hald/linux/addons/addon-cpufreq.c
index 796d76b..c8eedb9 100644
--- a/hald/linux/addons/addon-cpufreq.c
+++ b/hald/linux/addons/addon-cpufreq.c
@@ -831,9 +831,13 @@ static gboolean dbus_is_privileged(DBusC
}
caller_dbus_name = dbus_message_get_sender(message);
+ if (caller_dbus_name == NULL) {
+ dbus_raise_error(connection, message, CPUFREQ_ERROR_GENERAL,
+ "Cannot get D-Bus connection name of caller");
+ goto Error;
+ }
+
caller_unix_user = dbus_bus_get_unix_user(connection_new, caller_dbus_name, error);
- HAL_DEBUG(("Connection name of caller: %s", caller_dbus_name));
- HAL_DEBUG(("Unix user id of caller: %ld", caller_unix_user));
if (dbus_error_is_set(error)) {
dbus_raise_error(connection, message, CPUFREQ_ERROR_GENERAL,
"Cannot get unix user of caller");
@@ -841,6 +845,9 @@ static gboolean dbus_is_privileged(DBusC
goto Error;
}
+ HAL_DEBUG(("Connection name of caller: %s", caller_dbus_name));
+ HAL_DEBUG(("Unix user id of caller: %ld", caller_unix_user));
+
caller_unix_user_str = g_strdup_printf("%ld", caller_unix_user);
res = libpolkit_is_uid_allowed_for_privilege(polctx,
caller_dbus_name,
diff-tree a22c4dcaa0b9f53c43f4510bf4033edeec0f5115 (from e543d270ef4113a7d6a1cb51b56391b2794658d9)
Author: Holger Macht <holger at homac.de>
Date: Fri Dec 15 13:24:41 2006 +0100
revert logic for setting and getting "consider_nice" setting
Kernel ondemand governor has file 'ignore_nice_load', which
contains the opposite of the 'consider_nice' setting in
addon-cpufreq. So if ignore_nice_load is set to 0,
GetCPUFreqConsiderNice has to return TRUE. Analoguous for
SetCPUFreqConsiderNice.
diff --git a/hald/linux/addons/addon-cpufreq.c b/hald/linux/addons/addon-cpufreq.c
index 2dc271b..796d76b 100644
--- a/hald/linux/addons/addon-cpufreq.c
+++ b/hald/linux/addons/addon-cpufreq.c
@@ -383,7 +383,7 @@ static gboolean ondemand_set_consider_ni
consider_file = g_strdup_printf(ONDEMAND_IGNORE_NICE_LOAD_FILE, iface->base_cpu);
- if(!write_line(consider_file, "%u", consider)){
+ if(!write_line(consider_file, "%u", !consider)){
HAL_WARNING(("Could not set ignore_nice_load to: %u kHz; %s", consider,
strerror(errno)));
g_free(consider_file);
@@ -410,7 +410,7 @@ static gboolean ondemand_get_consider_ni
}
g_free(governor_file);
- return consider;
+ return !consider;
}
static gboolean ondemand_init(struct ondemand_interface *iface, GSList *cores)
More information about the hal-commit
mailing list