summaryrefslogtreecommitdiff
path: root/libsysfs
diff options
context:
space:
mode:
authordsteklof@us.ibm.com <dsteklof@us.ibm.com>2003-11-26 17:31:59 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:04 -0700
commitb376d32cb462455053061d2cf3da3ac640fd37ee (patch)
tree6d89970a308e45ccbe8b863da6c0e483b9f20135 /libsysfs
parentff44a6b0b7e98c9f696ee13c197d982819991de8 (diff)
[PATCH] quick fix for libsysfs bus
There seems to be a mismatch in udev and in libsysfs as to what to expect if the mnt point has a slash on the end or not. If I use the included patch, it breaks something in udev. If I patch sysfs_get_mnt_path I break udev as well because what you're expecting. I need to sit down and go through the library and creaate a rule as to trailing slashes. Adding the env brought this to light.
Diffstat (limited to 'libsysfs')
-rw-r--r--libsysfs/sysfs_device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libsysfs/sysfs_device.c b/libsysfs/sysfs_device.c
index fbd046f229..2a5353e6f7 100644
--- a/libsysfs/sysfs_device.c
+++ b/libsysfs/sysfs_device.c
@@ -28,6 +28,7 @@ static int confirm_device_bus(struct sysfs_device *dev,
{
struct sysfs_link *devlink = NULL;
unsigned char devpath[SYSFS_PATH_MAX];
+ unsigned char *s = NULL;
int result = 0;
if (busname == NULL || bus_id == NULL)
@@ -36,6 +37,9 @@ static int confirm_device_bus(struct sysfs_device *dev,
if (sysfs_get_mnt_path(devpath, SYSFS_PATH_MAX) != 0)
return -1;
+ s = &devpath[strlen(devpath)-1];
+ if (strncmp(s, "/", 1) == 0)
+ *s = '\0';
strcat(devpath, SYSFS_BUS_DIR);
strcat(devpath, "/");
strcat(devpath, busname);