summaryrefslogtreecommitdiff
path: root/udev_lib.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-12 06:17:35 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:24:10 -0700
commitc6478ec1e128f0a92c2123ed110a651b88d43569 (patch)
treecfefe6c87301604bb838f1a5eb566f1206d975d2 /udev_lib.c
parent31fd340352236c06c30a85fa9fbdbfbbd10bd439 (diff)
[PATCH] add ACTION to udev object to expose it to the whole process
Diffstat (limited to 'udev_lib.c')
-rw-r--r--udev_lib.c54
1 files changed, 3 insertions, 51 deletions
diff --git a/udev_lib.c b/udev_lib.c
index 7fb45f0b5f..951d36b1d7 100644
--- a/udev_lib.c
+++ b/udev_lib.c
@@ -35,56 +35,6 @@
#include "list.h"
-char *get_action(void)
-{
- char *action;
-
- action = getenv("ACTION");
- if (action != NULL && strlen(action) > ACTION_SIZE)
- action[ACTION_SIZE-1] = '\0';
-
- return action;
-}
-
-char *get_devpath(void)
-{
- char *devpath;
-
- devpath = getenv("DEVPATH");
- if (devpath != NULL && strlen(devpath) > DEVPATH_SIZE)
- devpath[DEVPATH_SIZE-1] = '\0';
-
- return devpath;
-}
-
-char *get_devname(void)
-{
- char *devname;
-
- devname = getenv("DEVNAME");
- if (devname != NULL && strlen(devname) > NAME_SIZE)
- devname[NAME_SIZE-1] = '\0';
-
- return devname;
-}
-
-char *get_seqnum(void)
-{
- char *seqnum;
-
- seqnum = getenv("SEQNUM");
-
- return seqnum;
-}
-
-char *get_subsystem(char *subsystem)
-{
- if (subsystem != NULL && strlen(subsystem) > SUBSYSTEM_SIZE)
- subsystem[SUBSYSTEM_SIZE-1] = '\0';
-
- return subsystem;
-}
-
#define BLOCK_PATH "/block/"
#define CLASS_PATH "/class/"
#define NET_PATH "/class/net/"
@@ -112,11 +62,13 @@ char get_device_type(const char *path, const char *subsystem)
return '\0';
}
-void udev_set_values(struct udevice *udev, const char* devpath, const char *subsystem)
+void udev_set_values(struct udevice *udev, const char* devpath,
+ const char *subsystem, const char* action)
{
memset(udev, 0x00, sizeof(struct udevice));
strfieldcpy(udev->devpath, devpath);
strfieldcpy(udev->subsystem, subsystem);
+ strfieldcpy(udev->action, action);
udev->type = get_device_type(devpath, subsystem);
}