From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sjoerd Simons Date: Mon, 05 Apr 2004 21:09:38 +0000 Subject: [PATCH] DEVNODE -> DEVNAME transition fixes Message-Id: <20040405210938.GA4025@spring.luon.net> MIME-Version: 1 Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ" List-Id: To: linux-hotplug@vger.kernel.org --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, It seems that the transition from DEVNODE to DEVNAME wasn't done everywhere. This broke udev_dbus for me. Attached patch does the transition in the places it wasn't done yet. Sjoerd -- Nature is by and large to be found out of doors, a location where, it cannot be argued, there are never enough comfortable chairs. -- Fran Lebowitz --mP3DRpeJDSE+ciuQ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="devnode_to_devname.patch" diff -Naur udev-024/dev_d.c udev-024.patched/dev_d.c --- udev-024/dev_d.c 2004-04-03 00:47:29.000000000 +0200 +++ udev-024.patched/dev_d.c 2004-04-05 22:18:52.556518260 +0200 @@ -11,8 +11,8 @@ /* * This essentially emulates the following shell script logic in C: * DIR="/etc/dev.d" - * export DEVNODE="whatever_dev_name_udev_just_gave" - * for I in "${DIR}/$DEVNODE/"*.dev "${DIR}/$1/"*.dev "${DIR}/default/"*.dev ; do + * export DEVNAME="whatever_dev_name_udev_just_gave" + * for I in "${DIR}/$DEVNAME/"*.dev "${DIR}/$1/"*.dev "${DIR}/default/"*.dev ; do * if [ -f $I ]; then $I $1 ; fi * done * exit 1; diff -Naur udev-024/extras/dbus/udev_dbus.c udev-024.patched/extras/dbus/udev_dbus.c --- udev-024/extras/dbus/udev_dbus.c 2004-04-03 00:47:28.000000000 +0200 +++ udev-024.patched/extras/dbus/udev_dbus.c 2004-04-05 22:19:58.598966260 +0200 @@ -80,10 +80,10 @@ /** Send out a signal that a device node is created * - * @param devnode name of the device node, e.g. /dev/sda1 + * @param devname name of the device node, e.g. /dev/sda1 * @param path Sysfs path of device */ -static void sysbus_send_create(const char *devnode, const char *path) +static void sysbus_send_create(const char *devname, const char *path) { DBusMessage* message; DBusMessageIter iter; @@ -94,7 +94,7 @@ "NodeCreated"); dbus_message_iter_init(message, &iter); - dbus_message_iter_append_string(&iter, devnode); + dbus_message_iter_append_string(&iter, devname); dbus_message_iter_append_string(&iter, path); if ( !dbus_connection_send(sysbus_connection, message, NULL) ) @@ -107,10 +107,10 @@ /** Send out a signal that a device node is deleted * - * @param devnode Name of the device node, e.g. /udev/sda1 + * @param devname Name of the device node, e.g. /udev/sda1 * @param path Sysfs path of device */ -static void sysbus_send_remove(const char *devnode, const char *path) +static void sysbus_send_remove(const char *devname, const char *path) { DBusMessage* message; DBusMessageIter iter; @@ -121,7 +121,7 @@ "NodeDeleted"); dbus_message_iter_init(message, &iter); - dbus_message_iter_append_string(&iter, devnode); + dbus_message_iter_append_string(&iter, devname); dbus_message_iter_append_string(&iter, path); if ( !dbus_connection_send(sysbus_connection, message, NULL) ) @@ -136,7 +136,7 @@ { char *action; char *devpath; - char *devnode; + char *devname; int retval = 0; init_logging("udev_dbus"); @@ -155,17 +155,17 @@ dbg("no devpath?"); goto exit; } - devnode = get_devnode(); - if (!devnode) { - dbg("no devnode?"); + devname = get_devname(); + if (!devname) { + dbg("no devname?"); goto exit; } if (strcmp(action, "add") == 0) { - sysbus_send_create(devnode, devpath); + sysbus_send_create(devname, devpath); } else { if (strcmp(action, "remove") == 0) { - sysbus_send_remove(devnode, devpath); + sysbus_send_remove(devname, devpath); } else { dbg("unknown action '%s'", action); retval = -EINVAL; diff -Naur udev-024/extras/selinux/udev_selinux.c udev-024.patched/extras/selinux/udev_selinux.c --- udev-024/extras/selinux/udev_selinux.c 2004-04-03 00:47:28.000000000 +0200 +++ udev-024.patched/extras/selinux/udev_selinux.c 2004-04-05 22:20:27.013589259 +0200 @@ -48,7 +48,7 @@ { char *action; char *devpath; - char *devnode; + char *devname; int retval = 0; init_logging("udev_selinux"); @@ -58,14 +58,14 @@ dbg("no action?"); goto exit; } - devnode = get_devnode(); - if (!devnode) { - dbg("no devnode?"); + devname = get_devname(); + if (!devname) { + dbg("no devname?"); goto exit; } if (strcmp(action, "add") == 0) - selinux_add_node(devnode); + selinux_add_node(devname); exit: return retval; diff -Naur udev-024/udev_lib.c udev-024.patched/udev_lib.c --- udev-024/udev_lib.c 2004-04-03 00:47:29.000000000 +0200 +++ udev-024.patched/udev_lib.c 2004-04-05 22:18:09.047564313 +0200 @@ -58,15 +58,15 @@ return devpath; } -char *get_devnode(void) +char *get_devname(void) { - char *devnode; + char *devname; - devnode = getenv("DEVNODE"); - if (devnode != NULL && strlen(devnode) > NAME_SIZE) - devnode[NAME_SIZE-1] = '\0'; + devname = getenv("DEVNAME"); + if (devname != NULL && strlen(devname) > NAME_SIZE) + devname[NAME_SIZE-1] = '\0'; - return devnode; + return devname; } char *get_seqnum(void) diff -Naur udev-024/udev_lib.h udev-024.patched/udev_lib.h --- udev-024/udev_lib.h 2004-04-03 00:47:28.000000000 +0200 +++ udev-024.patched/udev_lib.h 2004-04-05 22:20:56.583237583 +0200 @@ -68,7 +68,7 @@ extern char *get_action(void); extern char *get_devpath(void); -extern char *get_devnode(void); +extern char *get_devname(void); extern char *get_seqnum(void); extern char *get_subsystem(char *subsystem); extern char get_device_type(const char *path, const char *subsystem); --mP3DRpeJDSE+ciuQ-- ------------------------------------------------------- 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=1470&alloc_id=3638&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