hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Thu Dec 14 19:14:32 PST 2006
hald/linux/blockdev.c | 5 ++---
hald/linux/hotplug.c | 1 -
hald/linux/osspec.c | 11 -----------
hald/util.c | 11 +++++++++++
hald/util.h | 2 ++
5 files changed, 15 insertions(+), 15 deletions(-)
New commits:
diff-tree e543d270ef4113a7d6a1cb51b56391b2794658d9 (from 0ad8decdb9923754bb1fd8e25f9be4b3b90f2840)
Author: David Zeuthen <davidz at redhat.com>
Date: Thu Dec 14 22:14:29 2006 -0500
fix for freeing static memory + move hal_util_readlink() into hald/util.c
diff --git a/hald/linux/blockdev.c b/hald/linux/blockdev.c
index 97097b7..7d11ad2 100644
--- a/hald/linux/blockdev.c
+++ b/hald/linux/blockdev.c
@@ -564,16 +564,15 @@ canonicalize_filename (gchar *filename)
static char *
resolve_symlink (const char *file)
{
- GError *error;
char *dir;
- gchar link[HAL_PATH_MAX] ;
+ gchar link[HAL_PATH_MAX];
char *f;
char *f1;
f = g_strdup (file);
memset(link, 0, HAL_PATH_MAX);
while (g_file_test (f, G_FILE_TEST_IS_SYMLINK)) {
- if(readlink(f, link, HAL_PATH_MAX-1)<0) {
+ if(readlink(f, link, HAL_PATH_MAX - 1) < 0) {
g_warning ("Cannot resolve symlink %s: %s", f, strerror(errno));
g_free (f);
f = NULL;
diff --git a/hald/linux/hotplug.c b/hald/linux/hotplug.c
index 7a089da..b5e62bf 100644
--- a/hald/linux/hotplug.c
+++ b/hald/linux/hotplug.c
@@ -135,7 +135,6 @@ hotplug_event_begin_sysfs (HotplugEvent
HAL_INFO (("%s is a device (subsystem)", hotplug_event->sysfs.sysfs_path));
hotplug_event->type = HOTPLUG_EVENT_SYSFS_DEVICE;
}
- g_free (subsystem_target);
}
}
diff --git a/hald/linux/osspec.c b/hald/linux/osspec.c
index 9fcfd51..a09debe 100644
--- a/hald/linux/osspec.c
+++ b/hald/linux/osspec.c
@@ -694,17 +694,6 @@ static gboolean get_parent_device(char *
return FALSE;
return TRUE;
}
-static gchar path_buffer [HAL_PATH_MAX];
-
-gchar *
-hal_util_readlink(gchar * link)
-{
- memset(path_buffer, 0, HAL_PATH_MAX);
- if(readlink(link, path_buffer, HAL_PATH_MAX-1)<0)
- return NULL;
-
- return path_buffer;
-}
/* return the first already known parent device */
gboolean
diff --git a/hald/util.c b/hald/util.c
index 9ff42c3..522e824 100644
--- a/hald/util.c
+++ b/hald/util.c
@@ -1087,3 +1087,14 @@ out:
}
+static gchar path_buffer [HAL_PATH_MAX];
+
+char *
+hal_util_readlink (const char *link)
+{
+ memset (path_buffer, 0, HAL_PATH_MAX);
+ if(readlink(link, path_buffer, HAL_PATH_MAX-1) < 0)
+ return NULL;
+
+ return path_buffer;
+}
diff --git a/hald/util.h b/hald/util.h
index b410453..85f0ab6 100644
--- a/hald/util.h
+++ b/hald/util.h
@@ -106,4 +106,6 @@ void hal_util_hexdump (const void *buf,
gboolean hal_util_is_mounted_by_hald (const char *mount_point);
+char *hal_util_readlink (const char *link);
+
#endif /* UTIL_H */
More information about the hal-commit
mailing list