diff options
author | greg@kroah.com <greg@kroah.com> | 2004-03-24 21:11:36 -0800 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:35:11 -0700 |
commit | 89fe4e00fe0ac4b5125a3a66ffe3d42366feb5da (patch) | |
tree | b0c9928a02bc584c24dc8a00d581891eba63e9cf | |
parent | 7e371e86a420cb82948b72ca3dd93915cb8dd764 (diff) |
[PATCH] add get_devnode() helper to udev_lib for udev_dbus program
-rw-r--r-- | udev_lib.c | 11 | ||||
-rw-r--r-- | udev_lib.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/udev_lib.c b/udev_lib.c index 50598a4a31..f095513c97 100644 --- a/udev_lib.c +++ b/udev_lib.c @@ -53,6 +53,17 @@ char *get_devpath(void) return devpath; } +char *get_devnode(void) +{ + char *devnode; + + devnode = getenv("DEVNODE"); + if (devnode != NULL && strlen(devnode) > NAME_SIZE) + devnode[NAME_SIZE-1] = '\0'; + + return devnode; +} + char *get_seqnum(void) { char *seqnum; diff --git a/udev_lib.h b/udev_lib.h index 565d87e9a5..5db6b5261a 100644 --- a/udev_lib.h +++ b/udev_lib.h @@ -68,6 +68,7 @@ do { \ extern char *get_action(void); extern char *get_devpath(void); +extern char *get_devnode(void); extern char *get_seqnum(void); extern char *get_subsystem(char *subsystem); extern int file_map(const char *filename, char **buf, size_t *bufsize); |