linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] handle netdev in udevruler
@ 2004-04-02 18:29 Kay Sievers
  2004-04-02 22:16 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Kay Sievers @ 2004-04-02 18:29 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 161 bytes --]

Here we get the netdev handling for udevruler, after all information
is available now in the udev database. It also fixes the way libsysfs is
used.

thanks,
Kay

[-- Attachment #2: 01-udevruler-netdev.patch --]
[-- Type: text/plain, Size: 1888 bytes --]

===== udevruler.c 1.3 vs edited =====
--- 1.3/udevruler.c	Sun Mar 28 18:33:33 2004
+++ edited/udevruler.c	Fri Apr  2 20:26:23 2004
@@ -222,6 +222,7 @@
 			}
 		}
 
+	sysfs_close_directory(sysfs_dir);
 	return 0;
 }
 
@@ -229,7 +230,6 @@
 {
 	struct sysfs_class_device *class_dev;
 	struct sysfs_class_device *class_dev_parent;
-	struct sysfs_attribute *attr;
 	struct sysfs_device *sysfs_dev;
 	struct sysfs_device *sysfs_dev_parent;
 	char key[NAME_SIZE];
@@ -246,16 +246,6 @@
 		return -1;
 	}
 
-	/* read the 'dev' file for major/minor*/
-	attr = sysfs_get_classdev_attr(class_dev, "dev");
-	if (attr == NULL) {
-		dbg("couldn't get the \"dev\" file");
-		retval = -1;
-		goto exit;
-	}
-
-	sysfs_close_attribute(attr);
-
 	/* open sysfs class device directory and get all attributes */
 	if (add_all_attributes(class_dev->path, level) != 0) {
 		dbg("couldn't open class device directory");
@@ -266,11 +256,10 @@
 
 	/* get the device link (if parent exists look here) */
 	class_dev_parent = sysfs_get_classdev_parent(class_dev);
-	if (class_dev_parent != NULL) {
-		//sysfs_close_class_device(class_dev);
-		class_dev = class_dev_parent;
-	}
-	sysfs_dev = sysfs_get_classdev_device(class_dev);
+	if (class_dev_parent != NULL)
+		sysfs_dev = sysfs_get_classdev_device(class_dev_parent);
+	else
+		sysfs_dev = sysfs_get_classdev_device(class_dev);
 
 	/* look the device chain upwards */
 	while (sysfs_dev != NULL) {
@@ -290,13 +279,11 @@
 		if (sysfs_dev_parent == NULL)
 			break;
 
-		//sysfs_close_device(sysfs_dev);
 		sysfs_dev = sysfs_dev_parent;
 	}
-	sysfs_close_device(sysfs_dev);
 
 exit:
-	//sysfs_close_class_device(class_dev);
+	sysfs_close_class_device(class_dev);
 	return retval;
 }
 
@@ -403,7 +390,7 @@
 		int i;
 		int numitems;
 		struct attribute **selattr;
-		char text_rule[80];
+		char text_rule[255];
 
 		answer = newtRunForm(form);
 		if (answer == quit)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] handle netdev in udevruler
  2004-04-02 18:29 [PATCH] handle netdev in udevruler Kay Sievers
@ 2004-04-02 22:16 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-04-02 22:16 UTC (permalink / raw)
  To: linux-hotplug

On Fri, Apr 02, 2004 at 08:29:24PM +0200, Kay Sievers wrote:
> Here we get the netdev handling for udevruler, after all information
> is available now in the udev database. It also fixes the way libsysfs is
> used.

Applied, thanks.

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-02 22:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-02 18:29 [PATCH] handle netdev in udevruler Kay Sievers
2004-04-02 22:16 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).