diff options
author | Scott James Remnant <scott@ubuntu.com> | 2009-02-11 17:38:56 +0000 |
---|---|---|
committer | Scott James Remnant <scott@ubuntu.com> | 2009-02-11 17:38:56 +0000 |
commit | bd284db142c1d3fb6e2a709678c8828c12c52466 (patch) | |
tree | 955c71b48e38c2bcc99a8a422b0b7c8548ea9501 /udev/udev-event.c | |
parent | 10b2d011e70ddf9361c61f6147dc88f670d28abd (diff) |
udevd: optionally watch device nodes with inotify
This allows you to re-process the rules if the content of the device
has been changed, most useful for block subsystem to cause vol_id to
be run again.
Diffstat (limited to 'udev/udev-event.c')
-rw-r--r-- | udev/udev-event.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c index e34f09cfe3..592da01099 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -600,6 +600,14 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) /* create new node and symlinks */ err = udev_node_add(dev, event->mode, event->uid, event->gid); + + /* watch for changes */ + if (event->inotify_watch && inotify_fd != -1) { + info(event->udev, "device will be watched for changes\n"); + udev_watch_begin(event->udev, event->dev); + } else { + udev_watch_clear(event->udev, event->dev); + } goto exit; } |