summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-03-23 18:24:25 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:10 -0700
commitb608ade8e4b3df1f2e798dd460ce8ff4e70eb3d9 (patch)
tree94955f9c9fe1bc6a926454887bf8da186a8997d2 /namedev.c
parent166612d79decf5e7331a6bb65a60b4873551dfde (diff)
[PATCH] first stupid try for a rule compose gui
On Mon, Mar 15, 2004 at 09:28:17PM +0100, Kay Sievers wrote: > Here is a first simple and pretty stupid try to make a simple tool for > composing of a udev rule. > > It reads the udevdb to get all currently handled devices and presents a > list, where you can choose the device to compose the rule for. > > The composed rule is just printed out in a window, nothing else by now. > > Do we want something like this? > Nevermind, I always wanted to know, how this newt thing works :) Here is the next step, I still can't sleep and there are to many patches pending to make something useful :) Cause nobody wanted to play with me, I've made a screenshot. The device list is sorted in alphabetical order now and if there are only a few recently discovered devices, they are placed on top of the list. For those who want to have a look: http://vrfy.org/projects/udev/udevruler.png The patch applies on top of today's mmap() patch. The db format is changed to have the file and line number of the applied rule. So it should be easy to edit the matching rule with this beast. It compiles with "make all udevruler".
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/namedev.c b/namedev.c
index 8f781a66e2..e075e20af5 100644
--- a/namedev.c
+++ b/namedev.c
@@ -840,6 +840,8 @@ found:
apply_format(udev, udev->name, sizeof(udev->name), class_dev, sysfs_device);
apply_format(udev, udev->symlink, sizeof(udev->symlink), class_dev, sysfs_device);
udev->partitions = dev->partitions;
+ strfieldcpy(udev->config_file, dev->config_file);
+ udev->config_line = dev->config_line;
done:
/* get permissions given in rule */
@@ -862,6 +864,9 @@ done:
dbg("name, '%s' is going to have owner='%s', group='%s', mode = %#o",
udev->name, udev->owner, udev->group, udev->mode);
+ /* store time of action */
+ udev->config_time = time(NULL);
+
return 0;
}