summaryrefslogtreecommitdiffstats
path: root/sysutils/upower/files
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2010-04-07 06:53:43 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2010-04-07 06:53:43 +0800
commit20b7e1c7bbe6b8e086f44029dfb467984e645274 (patch)
tree4eab43815746279b230fe111c1923cc577fd4896 /sysutils/upower/files
parent90cda221316c54c018fd590c50f4755a26855d5d (diff)
downloadmarcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar.gz
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar.bz2
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar.lz
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar.xz
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.tar.zst
marcuscom-ports-20b7e1c7bbe6b8e086f44029dfb467984e645274.zip
Update to 0.9.2.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@14025 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'sysutils/upower/files')
-rw-r--r--sysutils/upower/files/patch-0003-add-backend-support-for-obtaining-kernel-info129
1 files changed, 0 insertions, 129 deletions
diff --git a/sysutils/upower/files/patch-0003-add-backend-support-for-obtaining-kernel-info b/sysutils/upower/files/patch-0003-add-backend-support-for-obtaining-kernel-info
deleted file mode 100644
index b09f01b7c..000000000
--- a/sysutils/upower/files/patch-0003-add-backend-support-for-obtaining-kernel-info
+++ /dev/null
@@ -1,129 +0,0 @@
-From 83a4bda6bfc4da2b454a4916f262dc025503b47a Mon Sep 17 00:00:00 2001
-From: Joe Marcus Clarke <marcus@FreeBSD.org>
-Date: Sat, 2 Jan 2010 14:04:57 -0500
-Subject: [PATCH 3/3] add backend support for obtaining kernel info
-
-Add FreeBSD-only support for pulling information about supported
-suspend states, commands, swap, etc. from the backend.
----
- src/up-backend.h | 14 +++++++
- src/up-daemon.c | 99 ++++++++++++++++++++++++++++++++++++-----------------
- 2 files changed, 81 insertions(+), 32 deletions(-)
-
-diff --git a/src/up-backend.h b/src/up-backend.h
-index c03bac9..f4e488f 100644
---- src/up-backend.h
-+++ src/up-backend.h
-@@ -68,6 +68,20 @@ void up_backend_test (gpointer user_data);
- gboolean up_backend_coldplug (UpBackend *backend,
- UpDaemon *daemon);
-
-+gboolean up_backend_can_suspend (UpBackend *backend);
-+
-+gboolean up_backend_can_hibernate (UpBackend *backend);
-+
-+gboolean up_backend_has_encrypted_swap (UpBackend *backend);
-+
-+gfloat up_backend_get_used_swap (UpBackend *backend);
-+
-+gchar *up_backend_get_powersave_command (UpBackend *backend, gboolean powersave);
-+
-+gchar *up_backend_get_suspend_command (UpBackend *backend);
-+
-+gchar *up_backend_get_hibernate_command (UpBackend *backend);
-+
- G_END_DECLS
-
- #endif /* __UP_BACKEND_H */
-diff --git a/src/up-daemon.c b/src/up-daemon.c
-index 47d84d5..4085fb3 100644
---- src/up-daemon.c
-+++ src/up-daemon.c
-@@ -109,6 +109,7 @@ G_DEFINE_TYPE (UpDaemon, up_daemon, G_TYPE_OBJECT)
- static gboolean
- up_daemon_check_sleep_states (UpDaemon *daemon)
- {
-+#ifndef __FreeBSD__
- gchar *contents = NULL;
- GError *error = NULL;
- gboolean ret;
-@@ -128,6 +129,12 @@ up_daemon_check_sleep_states (UpDaemon *daemon)
- out:
- g_free (contents);
- return ret;
-+#else
-+ daemon->priv->kernel_can_suspend = up_backend_can_suspend (daemon->priv->backend);
-+ daemon->priv->kernel_can_hibernate = up_backend_can_hibernate (daemon->priv->backend);
-+
-+ return TRUE;
-+#endif
- }
-
- /**
-@@ -146,6 +153,7 @@ out:
- static gboolean
- up_daemon_check_encrypted_swap (UpDaemon *daemon)
- {
-+#ifndef __FreeBSD__
- gchar *contents_swaps = NULL;
- gchar *contents_crypttab = NULL;
- gchar **lines_swaps = NULL;
-@@ -235,6 +243,9 @@ out:
- g_strfreev (lines_swaps);
- g_strfreev (lines_crypttab);
- return encrypted_swap;
-+#else
-+ return up_backend_has_encrypted_swap (daemon->priv->backend);
-+#endif
- }
-
- /**
-@@ -243,6 +254,7 @@ out:
- static gfloat
- up_daemon_check_swap_space (UpDaemon *daemon)
- {
-+#ifndef __FreeBSD__
- gchar *contents = NULL;
- gchar **lines = NULL;
- GError *error = NULL;
-@@ -295,6 +297,9 @@ out:
- g_free (contents);
- g_strfreev (lines);
- return percentage;
-+#else
-+ return up_backend_get_used_swap (daemon->priv->backend);
-+#endif
- }
-
- /**
-@@ -423,13 +428,21 @@ up_daemon_set_pmutils_powersave (UpDaemon *daemon, gboolean powersave)
- GError *error = NULL;
-
- /* run script from pm-utils */
-+#ifndef __FreeBSD__
- command = g_strdup_printf ("/usr/sbin/pm-powersave %s", powersave ? "true" : "false");
-- egg_debug ("excuting command: %s", command);
-- ret = g_spawn_command_line_async (command, &error);
-- if (!ret) {
-- egg_warning ("failed to run script: %s", error->message);
-- g_error_free (error);
-- goto out;
-+#else
-+ command = up_backend_get_powersave_command (daemon->priv->backend, powersave);
-+#endif
-+ if (command != NULL) {
-+ egg_debug ("excuting command: %s", command);
-+ ret = g_spawn_command_line_async (command, &error);
-+ if (!ret) {
-+ egg_warning ("failed to run script: %s", error->message);
-+ g_error_free (error);
-+ goto out;
-+ }
-+ } else {
-+ return TRUE;
- }
- out:
- g_free (command);
---
-1.6.5.7
-