hal: Branch 'master' - 3 commits
Martin Pitt
martin at kemper.freedesktop.org
Thu Nov 5 06:08:43 PST 2009
hald/util.c | 4 ++++
tools/hal-disable-polling.c | 3 ++-
tools/umount-hal.c | 5 +++--
3 files changed, 9 insertions(+), 3 deletions(-)
New commits:
commit 6d8eed9015a6ca648fe1dad575621b6ea959a748
Author: Michael Biebl <biebl at debian.org>
Date: Thu Nov 5 03:11:30 2009 +0100
Support relative paths in umount.hal
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552139
diff --git a/tools/umount-hal.c b/tools/umount-hal.c
index 719943c..81c3e08 100644
--- a/tools/umount-hal.c
+++ b/tools/umount-hal.c
@@ -31,12 +31,13 @@
#include <string.h>
#include <libhal.h>
#include <libhal-storage.h>
+#include "../hald/util.h"
int
main (int argc, char *argv[])
{
int ret;
- char *device_file_or_mount_point;
+ char device_file_or_mount_point[HAL_PATH_MAX];
DBusError error;
DBusConnection *con;
LibHalContext *hal_ctx;
@@ -58,7 +59,7 @@ main (int argc, char *argv[])
* first argument. TODO XXX FIXME: we ought to honor
* umount(8) options like -v for verbose.
*/
- device_file_or_mount_point = argv[1];
+ realpath(argv[1], device_file_or_mount_point);
dbus_error_init (&error);
con = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
commit 3181fd30f1e1e6ef940e5586c6683a37cac3fb81
Author: Michael Biebl <biebl at debian.org>
Date: Thu Nov 5 03:09:22 2009 +0100
Fix unconditional usage of PATH_MAX
Hal currently FTBFS on GNU/Hurd because of unconditional PATH_MAX usage.
Use HAL_PATH_MAX instead.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552386
diff --git a/tools/hal-disable-polling.c b/tools/hal-disable-polling.c
index 4aea90c..346d4d2 100644
--- a/tools/hal-disable-polling.c
+++ b/tools/hal-disable-polling.c
@@ -37,6 +37,7 @@
#include <getopt.h>
#include <glib.h>
#include <libhal.h>
+#include "../hald/util.h"
/**
* usage:
@@ -183,7 +184,7 @@ main (int argc, char *argv[])
devices = libhal_manager_find_device_string_match (hal_ctx, "block.device", device, &num_devices, NULL);
if (devices == NULL || devices[0] == NULL) {
- char real_device[PATH_MAX];
+ char real_device[HAL_PATH_MAX];
if (realpath(device, real_device) == NULL) {
fprintf (stderr, "Cannot find device %s.\n", device);
commit d8349cc9f90c00c06434b5f0c7e975ecb311a4e4
Author: Michael Biebl <biebl at debian.org>
Date: Thu Nov 5 03:08:26 2009 +0100
Fix a crasher in hal_util_get_last_element
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=531383
diff --git a/hald/util.c b/hald/util.c
index 7fa3011..5986686 100644
--- a/hald/util.c
+++ b/hald/util.c
@@ -106,6 +106,10 @@ hal_util_get_last_element (const gchar *s)
int len;
const gchar *p;
+ if (s == NULL) {
+ return NULL;
+ }
+
len = strlen (s);
for (p = s + len - 1; p > s; --p) {
if ((*p) == '/')
More information about the hal-commit
mailing list