hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Fri Apr 4 04:20:39 PDT 2008
tools/hal-disable-polling.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 80337b4ecb66df0f8bf107cdb432491fbd71b9a2
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Fri Apr 4 13:20:00 2008 +0200
fixed usage of realpath()
Fixed usage of realpath() reported via fd.o bug #15275.
From the report:
> gives a bus error on darwin. The invocation of realpath() where the second
> parameter is NULL is a glibc extension, not part of the standard function.
diff --git a/tools/hal-disable-polling.c b/tools/hal-disable-polling.c
index 20bcd49..83c770a 100644
--- a/tools/hal-disable-polling.c
+++ b/tools/hal-disable-polling.c
@@ -79,7 +79,7 @@ int
main (int argc, char *argv[])
{
char *udi = NULL;
- char *device = NULL, *real_device;
+ char *device = NULL;
dbus_bool_t is_version = FALSE;
dbus_bool_t enable_polling = FALSE;
DBusError error;
@@ -182,8 +182,9 @@ 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) {
- real_device = realpath(device, NULL);
- if (real_device == NULL) {
+ char real_device[PATH_MAX];
+
+ if (realpath(device, real_device) == NULL) {
fprintf (stderr, "Cannot find device %s.\n", device);
return 1;
}
@@ -197,7 +198,6 @@ main (int argc, char *argv[])
}
fprintf (stderr, "Following symlink from %s to %s.\n", device, real_device);
- free(real_device);
}
for (n = 0; devices[n] != NULL; n++) {
More information about the hal-commit
mailing list