summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsjoerd@spring.luon.net <sjoerd@spring.luon.net>2004-04-08 18:48:56 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:15 -0700
commit4b06c852cb7da274b50f665a75367f901d8064ae (patch)
tree1452478c34cf0c0d1656dd58bff3ef5dc3d4196f
parent1321258af575f1e704aedfb3b6ed8aa341632a50 (diff)
[PATCH] DEVNODE -> DEVNAME transition fixes
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.
-rw-r--r--dev_d.c4
-rw-r--r--extras/dbus/udev_dbus.c24
-rw-r--r--extras/selinux/udev_selinux.c10
-rw-r--r--udev_lib.c12
-rw-r--r--udev_lib.h2
5 files changed, 26 insertions, 26 deletions
diff --git a/dev_d.c b/dev_d.c
index 483ceb4b1b..81c7013315 100644
--- a/dev_d.c
+++ b/dev_d.c
@@ -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 --git a/extras/dbus/udev_dbus.c b/extras/dbus/udev_dbus.c
index 955a3dbb49..e99e92ec87 100644
--- a/extras/dbus/udev_dbus.c
+++ b/extras/dbus/udev_dbus.c
@@ -80,10 +80,10 @@ static void sysbus_connect(void)
/** 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 @@ static void sysbus_send_create(const char *devnode, const char *path)
"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 @@ static void sysbus_send_create(const char *devnode, const char *path)
/** 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 @@ static void sysbus_send_remove(const char *devnode, const char *path)
"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 @@ int main(int argc, char *argv[], char *envp[])
{
char *action;
char *devpath;
- char *devnode;
+ char *devname;
int retval = 0;
init_logging("udev_dbus");
@@ -155,17 +155,17 @@ int main(int argc, char *argv[], char *envp[])
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 --git a/extras/selinux/udev_selinux.c b/extras/selinux/udev_selinux.c
index bbbdd6ba53..df23d9e6a7 100644
--- a/extras/selinux/udev_selinux.c
+++ b/extras/selinux/udev_selinux.c
@@ -48,7 +48,7 @@ int main(int argc, char *argv[], char *envp[])
{
char *action;
char *devpath;
- char *devnode;
+ char *devname;
int retval = 0;
init_logging("udev_selinux");
@@ -58,14 +58,14 @@ int main(int argc, char *argv[], char *envp[])
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 --git a/udev_lib.c b/udev_lib.c
index db1096ebf7..381492db01 100644
--- a/udev_lib.c
+++ b/udev_lib.c
@@ -58,15 +58,15 @@ char *get_devpath(void)
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 --git a/udev_lib.h b/udev_lib.h
index e412ba96f4..cc264fa9b4 100644
--- a/udev_lib.h
+++ b/udev_lib.h
@@ -68,7 +68,7 @@ do { \
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);