Skip to contentSkip to conversation

patches for udev 019

PATCH Applied Marco d'Itri 3 participants 4 messages Feb 29, 2004 – Mar 1, 2004

lore
Share & tools
lore
#0 lore raw

fix_expr: remove usage of expr in ide-devfs.sh, because it may be in /usr/bin and not available at early boot time.

man-dashes.diff: escape dashes in man pages, helps with UTF-8 locales (by Philipp Matthias Hahn).

no_error_on_enoent: do not exit with an error and delete all files when a device or directory does not exist.

udevsend.8 by by Philipp Matthias Hahn.

Signature · 2 lines
ciao, |
Marco | [4695 sc.Be13Nezixw]
extras/ide-devfs.sh +3 -3
diff -ruN udev-018.orig/extras/ide-devfs.sh udev-018/extras/ide-devfs.sh
@@ -8,7 +8,7 @@
 TARGET="${2#[0-9]\.}"
 
 if [ -z "${HOST#[13579]}" ]; then
-	HOST=`expr ${HOST} - 1`
+	HOST=$((${HOST} - 1))
 	BUS="1"
 else
 	BUS="0"
@@ -24,7 +24,7 @@
 		if [ -e "${x}" ]; then
 			MEDIA=`cat ${x}`
 			if [ "${MEDIA}" = "$2" ]; then
-				num=`expr ${num} + 1`
+				num=$((${num} + 1))
 			fi
 			if [ "${x}" = "/proc/ide/${DRIVE}/media" ]; then
 				break
@@ -32,7 +32,7 @@
 		fi
 	done
 	
-	echo `expr ${num} - 1`
+	echo $((${num} - 1))
 }
 
 if [ -z "$3" ]; then
udev.8 +3 -3
@@ -270,8 +270,8 @@
 .B [ ]
 Matches any single character specified within the brackets. For example, the
 pattern string "tty[SR]" would match either "ttyS" or "ttyR".  Ranges are also
-supported within this match with the '-' character.  For example, to match on
-the range of all digits, the pattern [0-9] would be used. If the first character
+supported within this match with the '\-' character.  For example, to match on
+the range of all digits, the pattern [0\-9] would be used. If the first character
 following the '[' is a '!' then any character not enclosed is matched.
 .SH "FILES"
 .nf
@@ -285,7 +285,7 @@
 .BR hotplug (8)
 .PP
 The
-.I http://linux-hotplug.sourceforge.net/
+.I http://linux\-hotplug.sourceforge.net/
 web site.
 .SH AUTHORS
 .B udev
udevinfo.8 +11 -11
@@ -3,7 +3,7 @@
 udevinfo \- retrieve information from udev
 .SH SYNOPSIS
 .B udevinfo
-.RI "[-q " query_type " -p " sysfs_path "] [-drVh]"
+.RI "[\-q " query_type " \-p " sysfs_path "] [\-drVh]"
 .SH "DESCRIPTION"
 .B udevinfo
 allows users to query the udev database for information on any of the devices
@@ -13,40 +13,40 @@
 rule files.
 .SH "OPTIONS"
 .TP
-.B -V
+.B \-V
 Print the version information.
 .TP
-.B -r
+.B \-r
 Print the the
 .B udev_root
 directory. When used in conjunction with a query for the node name, the
 .B udev_root
 will be prepended.
 .TP
-.BI -q " query_type"
+.BI \-q " query_type"
 Query the database for specified value of a created device node.
-.RB Needs " -p " or " -n " specified.
+.RB Needs " \-p " or " \-n " specified.
 .br
 Valid types are:
 .BR name ", " symlink ", " mode " ," owner " , " group " or " path.
 .TP
-.BI -p " sysfs_path"
+.BI \-p " sysfs_path"
 Specify the sysfs path of the device to query.
 .TP
-.BI -n " name"
+.BI \-n " name"
 Specify the name of the node for the device to query.
 .TP
-.B -a
+.B \-a
 Print all
 .BI SYSFS{ filename }
 attributes along the device chain. Useful for for finding
 unique attributes to compose a rule.
-.RB Needs " -p " specified.
+.RB Needs " \-p " specified.
 .TP
-.B -d
+.B \-d
 Dump the whole database.
 .TP
-.B -h
+.B \-h
 Print help text.
 .SH "FILES"
 .nf
udev-remove.c +6 -0
diff -ruNp udev-019.orig/udev-remove.c udev-019/udev-remove.c
@@ -51,6 +51,8 @@ static int delete_path(char *path)
 
 		/* remove if empty */
 		retval = rmdir(path);
+		if (errno == ENOENT)
+			retval = 0;
 		if (retval) {
 			if (errno == ENOTEMPTY)
 				return 0;
@@ -77,6 +79,8 @@ static int delete_node(struct udevice *d
 
 	info("removing device node '%s'", filename);
 	retval = unlink(filename);
+	if (errno == ENOENT)
+		retval = 0;
 	if (retval) {
 		dbg("unlink(%s) failed with error '%s'",
 			filename, strerror(errno));
@@ -108,6 +112,8 @@ static int delete_node(struct udevice *d
 
 			dbg("unlinking symlink '%s'", filename);
 			retval = unlink(filename);
+			if (errno == ENOENT)
+				retval = 0;
 			if (retval) {
 				dbg("unlink(%s) failed with error '%s'",
 					filename, strerror(errno));

.TH UDEVSEND 8 "February 2004" "" "Linux Administrator's Manual" .SH NAME
udevsend \- Linux dynamic device naming daemon
.SH SYNOPSIS
.BI udevsend " hotplug-subsystem"
.SH
.B udevsend
sends device creation and removal events to the
.B udevd
daemon.
.SH ENVIRONMENT
.TP
ACTION
.B add
or
.B remove
.TP
DEVPATH
sysfs-path of the device to be added or removed
.TP
SEQNUM
Sequence number of event.
.SH "SEE ALSO"
.BR udev (8),
.BR udevd (8)
.PP
The
.I http://linux-hotplug.sourceforge.net/
web site.
.SH AUTHORS
.B udev
was developed by Greg Kroah-Hartman <[email protected]> with much help from Dan Stekloff <[email protected]>, Kay Sievers <[email protected]>, and many others.

#1 lore raw
Quoted 1 line · Marco d'Itri

udevsend.8 by by Philipp Matthias Hahn.

What's wrong with the current combined udevd/udevsend page? udevsend.8 is already a link to udevd.8. udevd.8 and the Makefile needs to be changed too, if you want to add a separate udevsend.8. page, but is it really needed?

Btw, could you please send independent patches in separate mails, it's easier to reply, to comment on the code, the mail threads are preserved and Greg can apply the mail directly to his tree. And you may use CTRL-D on the attached patch in mutt to inline it, so it's displayed by default.

thanks,
Kay

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Marco d'Itri
Quoted 3 lines · Kay Sievers
Quoted 1 line · Marco d'Itri

udevsend.8 by by Philipp Matthias Hahn.

What's wrong with the current combined udevd/udevsend page?

Nothing. I suppose Philipp did not notice it, just forged about it...

Signature · 13 lines
ciao, |
Marco | [4809 inIjjaGnOe3RQ]


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Applied
#3 lore raw
In reply to Marco d'Itri
Quoted 8 lines · Marco d'Itri

fix_expr: remove usage of expr in ide-devfs.sh, because it may be in /usr/bin and not available at early boot time.

man-dashes.diff: escape dashes in man pages, helps with UTF-8 locales (by Philipp Matthias Hahn).

no_error_on_enoent: do not exit with an error and delete all files when a device or directory does not exist.

I've applied these three (Marco split them out and sent them to me off-list.)

thanks,

greg k-h

-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel