hal: Branch 'master' - 4 commits

Rob Taylor robtaylor at kemper.freedesktop.org
Mon Nov 26 09:10:54 PST 2007


 configure.in                                   |    8 ++++++++
 hald/hald_dbus.c                               |    6 ++----
 hald/linux/addons/addon-acpi-buttons-toshiba.c |    7 ++++++-
 hald/linux/addons/addon-input.c                |    6 +++++-
 hald/linux/device.c                            |   15 ++++++++++-----
 hald/linux/probing/probe-input.c               |    7 ++++++-
 hald/massif-hald.sh                            |    8 +++++---
 tools/hal-setup-keymap.c                       |    6 +++++-
 8 files changed, 47 insertions(+), 16 deletions(-)

New commits:
commit a28556cc2f78c7d788cdcb35ef6f61fcbbd0f708
Author: Rob Taylor <rob.taylor at codethink.co.uk>
Date:   Thu Nov 8 23:51:47 2007 +0000

    fix uninitialised memory usage in pci_add
    
    pci_add was using vendor_name, product_name, subsys_vendor_name and
    subsys_product_name unitialised, causing random crashes and garbage output.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 0d30ff6..c346bd5 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1553,10 +1553,10 @@ pci_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
 
 	{
 		gchar buf[64];
-		char *vendor_name;
-		char *product_name;
-		char *subsys_vendor_name;
-		char *subsys_product_name;
+		char *vendor_name = NULL;
+		char *product_name = NULL;
+		char *subsys_vendor_name = NULL;
+		char *subsys_product_name = NULL;
 
 		ids_find_pci (hal_device_property_get_int (d, "pci.vendor_id"), 
 			      hal_device_property_get_int (d, "pci.product_id"), 
commit 26084ca9089d6d0b5c8952330244af70ddf58386
Author: Rob Taylor <rob.taylor at codethink.co.uk>
Date:   Mon Nov 26 16:44:08 2007 +0000

    the singleton hash not yet initialised is not an error
    
    In local_server_message_handler, only try to remove all the singletons for the
    connection if there are any singltons. Previous commit 1f2b6056 printed an
    error which is incorrect.

diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index ae37d9d..c24b2c9 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -5200,10 +5200,8 @@ local_server_message_handler (DBusConnection *connection,
 				helper_interface_handlers = g_slist_remove_link (helper_interface_handlers, i);
 			}
 		}
-	
-		if (G_UNLIKELY (!singletons)) {
-			HAL_ERROR (("Singleton table is not initialied/ is NULL"));
-		} else {
+
+		if (singletons)
 			g_hash_table_foreach_remove (singletons, (GHRFunc) singleton_remove_by_connection, connection);
 		}
 
commit 19852046f26615db65757e3016634a84c39d19c1
Author: Rob Taylor <rob.taylor at codethink.co.uk>
Date:   Sun Nov 11 21:07:53 2007 +0000

    make massif-hald.sh give more useful output
    
    Make massif_hald tell massif about g_slice as an alloc function.
    Set dbus_realloc as an alloc-fn when running massif.
    Increases num-callers and depth to 24 when caling massif.

diff --git a/hald/massif-hald.sh b/hald/massif-hald.sh
index f53396c..8f43259 100755
--- a/hald/massif-hald.sh
+++ b/hald/massif-hald.sh
@@ -16,9 +16,11 @@ export HAL_FDI_SOURCE_POLICY=.local-fdi/share/hal/fdi/policy
 #delete all old memory outputs, else we get hundreds
 rm massif.*
 
-valgrind --tool=massif --format=html --depth=10 \
-	 --alloc-fn=g_malloc --alloc-fn=g_realloc \
-	 --alloc-fn=g_try_malloc --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_alloc \
+G_SLICE="always-malloc" valgrind --num-callers=24 --tool=massif --depth=24 --format=html \
+        --alloc-fn=g_malloc --alloc-fn=g_realloc \
+	--alloc-fn=g_try_malloc --alloc-fn=g_malloc0 --alloc-fn=g_mem_chunk_all \
+        --alloc-fn=g_slice_alloc0 --alloc-fn=g_slice_alloc \
+	--alloc-fn=dbus_realloc \
 	 ./hald --daemon=no --verbose=yes --retain-privileges --exit-after-probing
 
 #massif uses the pid file, which is hard to process.
commit 3ede34abd7a074cf0b054772c60dd3095989e924
Author: Rob Taylor <rob.taylor at codethink.co.uk>
Date:   Mon Nov 26 17:09:11 2007 +0000

    add --with-linux-input-header configure switch
    
    This adds a --with-linux-input-header configure switch to allow the use of a
    local copy of the latest input.h without having it available in include search
    paths.

diff --git a/configure.in b/configure.in
index fc5a691..90f10f3 100644
--- a/configure.in
+++ b/configure.in
@@ -919,6 +919,14 @@ fi
 msg_sonypic=$have_sonypic
 AM_CONDITIONAL(HAVE_SONYPIC, [test x$msg_sonypic = xyes], [Compiling Sony PIC])
 
+dnl use non-system input.h
+AC_ARG_WITH([linux-input-header],
+	    AS_HELP_STRING([--with-linux-input-header=<path>],
+			   [Use an given Linux input.h rather than that installed on the system (<linux/input.h>)]))
+if test "x$with_linux_input_header" != "x"; then
+	AC_DEFINE_UNQUOTED(HAL_LINUX_INPUT_HEADER_H, "$with_linux_input_header", [If set, the header to use instead of <linux/input.h>])
+fi
+
 dnl
 dnl SUBSETTING END
 dnl
diff --git a/hald/linux/addons/addon-acpi-buttons-toshiba.c b/hald/linux/addons/addon-acpi-buttons-toshiba.c
index f336992..f0dc09d 100644
--- a/hald/linux/addons/addon-acpi-buttons-toshiba.c
+++ b/hald/linux/addons/addon-acpi-buttons-toshiba.c
@@ -29,7 +29,12 @@
 #  include <config.h>
 #endif
 
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+ #include HAL_LINUX_INPUT_HEADER_H
+else
+ #include <linux/input.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/hald/linux/addons/addon-input.c b/hald/linux/addons/addon-input.c
index 2ba923b..11d9ebc 100644
--- a/hald/linux/addons/addon-input.c
+++ b/hald/linux/addons/addon-input.c
@@ -36,7 +36,11 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+  #include HAL_LINUX_INPUT_HEADER_H
+#else
+  #include <linux/input.h>
+#endif
 #include <glib/gmain.h>
 #include <glib/gprintf.h>
 #include <dbus/dbus-glib-lowlevel.h>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 8cc12ef..0d30ff6 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -38,7 +38,12 @@
 #include <unistd.h>
 #include <asm/byteorder.h>
 #include <fcntl.h>
-#include <linux/input.h>
+
+#ifdef HAL_LINUX_INPUT_HEADER_H
+  #include HAL_LINUX_INPUT_HEADER_H
+#else
+  #include <linux/input.h>
+#endif
 
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib.h>
diff --git a/hald/linux/probing/probe-input.c b/hald/linux/probing/probe-input.c
index 6a107fb..6ace0fa 100644
--- a/hald/linux/probing/probe-input.c
+++ b/hald/linux/probing/probe-input.c
@@ -29,13 +29,18 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <linux/input.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
+#ifdef HAL_LINUX_INPUT_HEADER_H
+  #include HAL_LINUX_INPUT_HEADER_H
+#else
+  #include <linux/input.h>
+#endif
+
 #include "libhal/libhal.h"
 #include "../../logger.h"
 
diff --git a/tools/hal-setup-keymap.c b/tools/hal-setup-keymap.c
index 4ae82f5..24c51f9 100644
--- a/tools/hal-setup-keymap.c
+++ b/tools/hal-setup-keymap.c
@@ -31,7 +31,11 @@
 #include <unistd.h>
 #include <sys/ioctl.h>
 
-#include <linux/input.h>
+#ifdef HAL_LINUX_INPUT_HEADER_H
+  #include HAL_LINUX_INPUT_HEADER_H
+#else
+  #include <linux/input.h>
+#endif
 
 #include "libhal/libhal.h"
 #include "hal-setup-keymap-hash-name.h"


More information about the hal-commit mailing list