diff options
author | David Zeuthen <david@fubar.dk> | 2004-01-19 21:03:40 +0000 |
---|---|---|
committer | David Zeuthen <david@fubar.dk> | 2004-01-19 21:03:40 +0000 |
commit | 7b53df3433a82048e98ccb1ce0fd14170ede96e0 (patch) | |
tree | 3cadecd597cb7e6536636c933582640c150b10a0 | |
parent | 12556dc05aa2ee05dd6419397a1493ba925dd41e (diff) |
bump version to 0.2.6HAL_0_2_6
bump to 0.2.6
removed (linux_class_v4l_init): don't call get_udev_root()
(visit_class_device_v4l): use new options in udev-013
removed (linux_class_block_init): don't call get_udev_root()
(visit_class_device_block_got_parent): use new options in udev-013
-rw-r--r-- | ChangeLog | 14 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | hald/linux/linux_class_block.c | 68 | ||||
-rw-r--r-- | hald/linux/linux_class_v4l.c | 60 | ||||
-rw-r--r-- | packaging/fedora/hal.spec | 2 |
5 files changed, 21 insertions, 127 deletions
@@ -1,5 +1,19 @@ 2004-01-19 David Zeuthen <david@fubar.dk> + * configure.in: bump version to 0.2.6 + + * packaging/fedora/hal.spec (Version): bump to 0.2.6 + + * hald/linux/linux_class_v4l.c (get_udev_root): removed + (linux_class_v4l_init): don't call get_udev_root() + (visit_class_device_v4l): use new options in udev-013 + + * hald/linux/linux_class_block.c (get_udev_root): removed + (linux_class_block_init): don't call get_udev_root() + (visit_class_device_block_got_parent): use new options in udev-013 + +2004-01-19 David Zeuthen <david@fubar.dk> + * hald/linux/linux_common.c (drivers_collect): Don't call DIE() if we cannot open the /sys/bus/<busname>/drivers directory - just ignore this error with HAL_WARNING() diff --git a/configure.in b/configure.in index 6e9e4e60..c3faa4d2 100644 --- a/configure.in +++ b/configure.in @@ -1,8 +1,8 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) -AC_INIT(hal, 0.2.5, david@fubar.dk) -AM_INIT_AUTOMAKE(hal, 0.2.5) +AC_INIT(hal, 0.2.6, david@fubar.dk) +AM_INIT_AUTOMAKE(hal, 0.2.6) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE diff --git a/hald/linux/linux_class_block.c b/hald/linux/linux_class_block.c index 563643e1..4f69a4db 100644 --- a/hald/linux/linux_class_block.c +++ b/hald/linux/linux_class_block.c @@ -65,9 +65,6 @@ static dbus_bool_t detect_media(HalDevice* d); * @{ */ -/** udev root directory, e.g. "/udev/" */ -static char udev_root[256]; - /** This function will compute the device uid based on other properties * of the device. For block device it's simply block appended with the * major and minor number @@ -245,12 +242,11 @@ static void visit_class_device_block_got_parent(HalDevice* parent, const char* path; int sysfs_mount_path_len; char sysfs_path_trunc[SYSFS_NAME_LEN]; - char* udev_argv[4] = {"/sbin/udev", "-q", + char* udev_argv[7] = {"/sbin/udev", "-r", "-q", "name", "-p", sysfs_path_trunc, NULL}; char* udev_stdout; char* udev_stderr; int udev_exitcode; - char dev_file[256]; path = ds_property_get_string(d, "linux.sysfs_path"); @@ -295,12 +291,9 @@ static void visit_class_device_block_got_parent(HalDevice* parent, } } - strncpy(dev_file, udev_root, 256); - strncat(dev_file, udev_stdout, 256); - - HAL_INFO(("device file = '%s'", dev_file)); + HAL_INFO(("device file = '%s'", udev_stdout)); - ds_property_set_string(d, "block.device", dev_file); + ds_property_set_string(d, "block.device", udev_stdout); /** @todo FIXME free udev_stdout, udev_stderr? */ } @@ -929,66 +922,11 @@ static void sigio_handler(int sig) sigio_etc_changed = TRUE; } -/** Find udev root directory (e.g. '/udev/') by invoking '/sbin/udev -r'. - * If this fails, we default to /udev/. - * - */ -static void get_udev_root() -{ - int i; - char* udev_argv[3] = {"/sbin/udev", "-r", NULL}; - char* udev_stdout; - char* udev_stderr; - int udev_exitcode; - - strncpy(udev_root, "/udev/", 256); - - /* Invoke udev */ - if( g_spawn_sync("/", - udev_argv, - NULL, - 0, - NULL, - NULL, - &udev_stdout, - &udev_stderr, - &udev_exitcode, - NULL)!=TRUE ) - { - HAL_ERROR(("Couldn't invoke /sbin/udev -r")); - return; - } - - if( udev_exitcode!=0 ) - { - HAL_ERROR(("/sbin/udev -r returned %d", udev_exitcode)); - return; - } - - /* sanitize string returned by udev */ - for(i=0; udev_stdout[i]!=0; i++) - { - if( udev_stdout[i]=='\r' || udev_stdout[i]=='\n' ) - { - udev_stdout[i]=0; - break; - } - } - - strncpy(udev_root, udev_stdout, 256); - - HAL_INFO(("udev root = '%s'", udev_root)); - - /** @todo FIXME free udev_stdout, udev_stderr? */ -} - - /** Init function for block device handling * */ void linux_class_block_init() { - get_udev_root(); } /** Force unmount of a patition. Must have block.volume=1 and valid diff --git a/hald/linux/linux_class_v4l.c b/hald/linux/linux_class_v4l.c index 991a078c..18e24795 100644 --- a/hald/linux/linux_class_v4l.c +++ b/hald/linux/linux_class_v4l.c @@ -49,9 +49,6 @@ * @{ */ -/** udev root directory, e.g. "/udev/" */ -static char udev_root[256]; - /* fwd decl */ static void visit_class_device_v4l_got_sysdevice(HalDevice* parent, void* data1, void* data2); @@ -121,7 +118,7 @@ void visit_class_device_v4l(const char* path, int i; int sysfs_mount_path_len; char sysfs_path_trunc[SYSFS_NAME_LEN]; - char* udev_argv[4] = {"/sbin/udev", "-q", + char* udev_argv[7] = {"/sbin/udev", "-r", "-q", "name", "-p", sysfs_path_trunc, NULL}; char* udev_stdout; char* udev_stderr; @@ -168,7 +165,6 @@ void visit_class_device_v4l(const char* path, } } - strncpy(dev_file, udev_root, 256); strncat(dev_file, udev_stdout, 256); /** @todo FIXME free udev_stdout, udev_stderr? */ @@ -269,65 +265,11 @@ static void visit_class_device_v4l_got_sysdevice(HalDevice* sysdevice, ds_device_destroy(d); } -/** Find udev root directory (e.g. '/udev/') by invoking '/sbin/udev -r'. - * If this fails, we default to /udev/. - * - */ -static void get_udev_root() -{ - int i; - char* udev_argv[3] = {"/sbin/udev", "-r", NULL}; - char* udev_stdout; - char* udev_stderr; - int udev_exitcode; - - strncpy(udev_root, "/udev/", 256); - - /* Invoke udev */ - if( g_spawn_sync("/", - udev_argv, - NULL, - 0, - NULL, - NULL, - &udev_stdout, - &udev_stderr, - &udev_exitcode, - NULL)!=TRUE ) - { - HAL_ERROR(("Couldn't invoke /sbin/udev -r")); - return; - } - - if( udev_exitcode!=0 ) - { - HAL_ERROR(("/sbin/udev -r returned %d", udev_exitcode)); - return; - } - - /* sanitize string returned by udev */ - for(i=0; udev_stdout[i]!=0; i++) - { - if( udev_stdout[i]=='\r' || udev_stdout[i]=='\n' ) - { - udev_stdout[i]=0; - break; - } - } - - strncpy(udev_root, udev_stdout, 256); - - HAL_INFO(("udev root = '%s'", udev_root)); - - /** @todo FIXME free udev_stdout, udev_stderr? */ -} - /** Init function for V4L adapter class handling * */ void linux_class_v4l_init() { - get_udev_root(); } /** This function is called when all device detection on startup is done diff --git a/packaging/fedora/hal.spec b/packaging/fedora/hal.spec index 434f77d1..fba049ff 100644 --- a/packaging/fedora/hal.spec +++ b/packaging/fedora/hal.spec @@ -4,7 +4,7 @@ Summary: Hardware Abstraction Layer Name: hal -Version: 0.2.5 +Version: 0.2.6 Release: 1 URL: http://www.freedesktop.org/software/hal/ Source0: %{name}-%{version}.tar.gz |