linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* patches for udev 019
@ 2004-02-29 13:49 Marco d'Itri
  2004-02-29 14:23 ` Kay Sievers
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marco d'Itri @ 2004-02-29 13:49 UTC (permalink / raw)
  To: linux-hotplug

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

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.

-- 
ciao, |
Marco | [4695 sc.Be13Nezixw]

[-- Attachment #2: fix_expr --]
[-- Type: text/plain, Size: 700 bytes --]

diff -ruN udev-018.orig/extras/ide-devfs.sh udev-018/extras/ide-devfs.sh
--- udev-018.orig/extras/ide-devfs.sh	2004-02-19 19:38:37.000000000 +0100
+++ udev-018/extras/ide-devfs.sh	2004-02-21 17:57:06.000000000 +0100
@@ -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

[-- Attachment #3: man-dashes.diff --]
[-- Type: text/plain, Size: 2351 bytes --]

--- udev-018/udev.8	2004-02-19 19:38:36.000000000 +0100
+++ udev-018/udev.8	2004-02-20 22:52:47.000000000 +0100
@@ -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
--- udev-018/udevinfo.8	2004-02-19 19:38:37.000000000 +0100
+++ udev-018/udevinfo.8	2004-02-20 22:53:26.000000000 +0100
@@ -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

[-- Attachment #4: no_error_on_enoent --]
[-- Type: text/plain, Size: 944 bytes --]

diff -ruNp udev-019.orig/udev-remove.c udev-019/udev-remove.c
--- udev-019.orig/udev-remove.c	2004-02-28 02:11:47.000000000 +0100
+++ udev-019/udev-remove.c	2004-02-28 16:09:24.000000000 +0100
@@ -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));

[-- Attachment #5: udevsend.8 --]
[-- Type: text/plain, Size: 677 bytes --]

.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 <greg@kroah.com> with much help from
Dan Stekloff <dsteklof@us.ibm.com>, Kay Sievers <kay.sievers@vrfy.org>, and
many others.

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

end of thread, other threads:[~2004-03-01 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-29 13:49 patches for udev 019 Marco d'Itri
2004-02-29 14:23 ` Kay Sievers
2004-02-29 14:25 ` Marco d'Itri
2004-03-01 22:39 ` 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).