hal/hald/linux net_class_device.c,1.19,1.20
David Zeuthen
david at freedesktop.org
Thu Oct 21 14:27:46 PDT 2004
Update of /cvs/hal/hal/hald/linux
In directory gabe:/tmp/cvs-serv28465/hald/linux
Modified Files:
net_class_device.c
Log Message:
2004-10-21 David Zeuthen <davidz at redhat.com>
* hald/linux/net_class_device.c (net_class_pre_process): Just see if
there is a 'wireless' directory in sysfs; don't let the libsysfs copy
try to open files cause that might fail on orinoco+hermes (RH bug
136591). Reported by Dan Williams <dcbw at redhat.com>
Index: net_class_device.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux/net_class_device.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- net_class_device.c 14 Oct 2004 18:41:27 -0000 1.19
+++ net_class_device.c 21 Oct 2004 21:27:44 -0000 1.20
@@ -509,10 +509,10 @@
int media_type = 0;
const char *media;
char wireless_path[SYSFS_PATH_MAX];
- struct sysfs_directory *wireless_dir;
dbus_bool_t is_80211 = FALSE;
int ifindex;
int flags;
+ struct stat statbuf;
hal_device_property_set_string (d, "net.linux.sysfs_path", sysfs_path);
hal_device_property_set_string (d, "net.interface",
@@ -521,18 +521,11 @@
/* Check to see if this interface supports wireless extensions */
is_80211 = FALSE;
snprintf (wireless_path, SYSFS_PATH_MAX, "%s/wireless", sysfs_path);
- wireless_dir = sysfs_open_directory (wireless_path);
-
- if (sysfs_read_directory (wireless_dir) >= 0) {
- if (wireless_dir->attributes != NULL) {
- hal_device_add_capability (d, "net.80211");
- is_80211 = TRUE;
- }
-
- sysfs_close_directory (wireless_dir);
+ if (stat (wireless_path, &statbuf) == 0) {
+ hal_device_add_capability (d, "net.80211");
+ is_80211 = TRUE;
}
-
attr = sysfs_get_classdev_attr (class_device, "address");
if (attr != NULL) {
address = g_strstrip (g_strdup (attr->value));
More information about the hal-commit
mailing list