[Pkg-utopia-commits] r508 - in packages/experimental/hal/debian: .
patches
Sjoerd Simons
sjoerd at costa.debian.org
Thu Jan 19 22:14:40 UTC 2006
Author: sjoerd
Date: 2006-01-19 22:14:40 +0000 (Thu, 19 Jan 2006)
New Revision: 508
Added:
packages/experimental/hal/debian/patches/02_hal_addon_pmu.patch
Modified:
packages/experimental/hal/debian/changelog
Log:
Fix the pmu addon
Modified: packages/experimental/hal/debian/changelog
===================================================================
--- packages/experimental/hal/debian/changelog 2006-01-19 22:09:25 UTC (rev 507)
+++ packages/experimental/hal/debian/changelog 2006-01-19 22:14:40 UTC (rev 508)
@@ -10,8 +10,12 @@
+ Added. Let the addons and probes be called by a little helper running as
root while the main hal database runs as an unpriviledged user.
* No longer chown removable device to group hal
+ * debian/patches/02_hal_addon_pmu.patch
+ + Added. Use a direct connection to hal, because it might not be on the
+ system bus yet. Open /dev/adb non-block so read blocks instead of
+ getting EAGAIN and failing.
- -- Sjoerd Simons <sjoerd at debian.org> Thu, 19 Jan 2006 22:53:16 +0100
+ -- Sjoerd Simons <sjoerd at debian.org> Thu, 19 Jan 2006 23:12:56 +0100
hal (0.5.5.1-5) unstable; urgency=low
Added: packages/experimental/hal/debian/patches/02_hal_addon_pmu.patch
===================================================================
--- packages/experimental/hal/debian/patches/02_hal_addon_pmu.patch 2006-01-19 22:09:25 UTC (rev 507)
+++ packages/experimental/hal/debian/patches/02_hal_addon_pmu.patch 2006-01-19 22:14:40 UTC (rev 508)
@@ -0,0 +1,40 @@
+diff -ruN hal-0.5.6-old/hald/linux2/addons/addon-pmu.c hal-0.5.6/hald/linux2/addons/addon-pmu.c
+--- hal-0.5.6-old/hald/linux2/addons/addon-pmu.c 2005-11-02 16:35:09.000000000 +0100
++++ hal-0.5.6/hald/linux2/addons/addon-pmu.c 2006-01-19 23:11:54.000000000 +0100
+@@ -66,15 +66,10 @@
+ goto out;
+
+ dbus_error_init (&error);
+- if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
+- goto out;
+-
+- if ((ctx = libhal_ctx_new ()) == NULL)
+- goto out;
+- if (!libhal_ctx_set_dbus_connection (ctx, conn))
+- goto out;
+- if (!libhal_ctx_init (ctx, &error))
++ if ((ctx = libhal_ctx_init_direct (&error)) == NULL) {
++ fprintf(stderr, "Context setup failed\n");
+ goto out;
++ }
+
+ /* initial state */
+ if ((strstate = getenv ("HAL_PROP_BUTTON_STATE_VALUE")) == NULL) {
+@@ -86,7 +81,7 @@
+ else
+ state = FALSE;
+
+- if ((fd = open ("/dev/adb", O_RDWR | O_NONBLOCK)) < 0) {
++ if ((fd = open ("/dev/adb", O_RDWR)) < 0) {
+ dbg ("Cannot open /dev/adb");
+ goto out;
+ }
+@@ -101,7 +96,7 @@
+ if (n == 2) {
+ rd = read (fd, buf, sizeof (buf));
+ if (rd <= 0) {
+- dbg ("Error reading from fd; read returned %d; err=%s", strerror (errno));
++ dbg ("Error reading from fd; read returned %d; err=%s", rd, strerror (errno));
+ goto out;
+ }
+
More information about the Pkg-utopia-commits
mailing list