[arch-commits] Commit in devicekit-power/repos (3 files)

Jan de Groot jgc at archlinux.org
Sat Dec 19 20:27:18 UTC 2009


    Date: Saturday, December 19, 2009 @ 15:27:17
  Author: jgc
Revision: 61580

Merged revisions 61579 via svnmerge from 
svn+ssh://gerolde.archlinux.org/srv/svn-packages/devicekit-power/trunk

........
  r61579 | jgc | 2009-12-19 21:26:56 +0100 (Sat, 19 Dec 2009) | 1 line
  
  Add missing patches
........

Added:
  devicekit-power/repos/extra-i686/check-swap.patch
    (from rev 61579, devicekit-power/trunk/check-swap.patch)
  devicekit-power/repos/extra-i686/fix-segfault-history.patch
    (from rev 61579, devicekit-power/trunk/fix-segfault-history.patch)
Modified:
  devicekit-power/repos/extra-i686/	(properties)

----------------------------+
 check-swap.patch           |   43 +++++++++++++++++++++++++++++++++++++++++++
 fix-segfault-history.patch |   25 +++++++++++++++++++++++++
 2 files changed, 68 insertions(+)


Property changes on: devicekit-power/repos/extra-i686
___________________________________________________________________
Modified: svnmerge-integrated
   - /devicekit-power/trunk:1-61560
   + /devicekit-power/trunk:1-61579

Copied: devicekit-power/repos/extra-i686/check-swap.patch (from rev 61579, devicekit-power/trunk/check-swap.patch)
===================================================================
--- extra-i686/check-swap.patch	                        (rev 0)
+++ extra-i686/check-swap.patch	2009-12-19 20:27:17 UTC (rev 61580)
@@ -0,0 +1,43 @@
+From bbb102c394eff71d84801b48b11e022b1fecb497 Mon Sep 17 00:00:00 2001
+From: Debbie Beliveau <debbie.beliveau at gmail.com>
+Date: Wed, 16 Dec 2009 16:29:29 +0000
+Subject: Check if swap exists before determining how much is free
+
+Signed-off-by: Richard Hughes <richard at hughsie.com>
+---
+diff --git a/src/dkp-daemon.c b/src/dkp-daemon.c
+index eb16a63..47d84d5 100644
+--- a/src/dkp-daemon.c
++++ b/src/dkp-daemon.c
+@@ -250,6 +250,7 @@ dkp_daemon_check_swap_space (DkpDaemon *daemon)
+ 	gboolean ret;
+ 	guint active = 0;
+ 	guint swap_free = 0;
++	guint swap_total = 0;
+ 	guint len;
+ 	guint i;
+ 	gfloat percentage = 0.0f;
+@@ -271,12 +272,21 @@ dkp_daemon_check_swap_space (DkpDaemon *daemon)
+ 		if (len > 3) {
+ 			if (g_strcmp0 (tokens[0], "SwapFree") == 0)
+ 				swap_free = atoi (tokens[len-2]);
++			if (g_strcmp0 (tokens[0], "SwapTotal") == 0)
++				swap_total = atoi (tokens[len-2]);
+ 			else if (g_strcmp0 (tokens[0], "Active") == 0)
+ 				active = atoi (tokens[len-2]);
+ 		}
+ 		g_strfreev (tokens);
+ 	}
+ 
++	/* first check if we even have swap, if not consider all swap space used */
++	if (swap_total == 0) {
++		egg_debug ("no swap space found");
++		percentage = 100.0f;
++		goto out;
++	}
++
+ 	/* work out how close to the line we are */
+ 	if (swap_free > 0 && active > 0)
+ 		percentage = (active * 100) / swap_free;
+--
+cgit v0.8.3-6-g21f6

Copied: devicekit-power/repos/extra-i686/fix-segfault-history.patch (from rev 61579, devicekit-power/trunk/fix-segfault-history.patch)
===================================================================
--- extra-i686/fix-segfault-history.patch	                        (rev 0)
+++ extra-i686/fix-segfault-history.patch	2009-12-19 20:27:17 UTC (rev 61580)
@@ -0,0 +1,25 @@
+From 0348f788d9dc1ac35ff07d2a15acc9da109ca60c Mon Sep 17 00:00:00 2001
+From: Richard Hughes <richard at hughsie.com>
+Date: Mon, 14 Dec 2009 12:35:14 +0000
+Subject: Fix segfault in the history code. Fixes fd#25632
+
+---
+diff --git a/src/dkp-history.c b/src/dkp-history.c
+index 23bf4c2..b851642 100644
+--- a/src/dkp-history.c
++++ b/src/dkp-history.c
+@@ -295,6 +295,12 @@ dkp_history_get_profile_data (DkpHistory *history, gboolean charging)
+ 
+ 		/* round to the nearest int */
+ 		bin = rint (obj->value);
++
++		/* ensure bin is in range */
++		if (bin >= data->len)
++			bin = data->len - 1;
++
++		/* different */
+ 		if (oldbin != bin) {
+ 			oldbin = bin;
+ 			if (obj_old != NULL) {
+--
+cgit v0.8.3-6-g21f6




More information about the arch-commits mailing list