mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
udevtest: add udev_rules_apply_format() to RUN keys
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
parent
a9bd2ed84a
commit
ad27f5b396
12
udev_add.c
12
udev_add.c
@ -135,16 +135,14 @@ static int create_node(struct udevice *udev)
|
||||
gid = lookup_group(udev->group);
|
||||
}
|
||||
|
||||
if (!udev->test_run) {
|
||||
info("creating device node '%s'", filename);
|
||||
info("creating device node '%s', major = '%d', minor = '%d', " "mode = '%#o', uid = '%d', gid = '%d'",
|
||||
filename, major(udev->devt), minor(udev->devt), udev->mode, uid, gid);
|
||||
|
||||
if (!udev->test_run)
|
||||
if (udev_make_node(udev, filename, udev->devt, udev->mode, uid, gid) != 0)
|
||||
goto error;
|
||||
|
||||
setenv("DEVNAME", filename, 1);
|
||||
} else {
|
||||
info("creating device node '%s', major = '%d', minor = '%d', "
|
||||
"mode = '%#o', uid = '%d', gid = '%d'", filename,
|
||||
major(udev->devt), minor(udev->devt), udev->mode, uid, gid);
|
||||
}
|
||||
|
||||
/* create all_partitions if requested */
|
||||
if (udev->partitions) {
|
||||
|
11
udevtest.c
11
udevtest.c
@ -113,11 +113,16 @@ int main(int argc, char *argv[], char *envp[])
|
||||
|
||||
info("looking at device '%s' from subsystem '%s'", udev->dev->devpath, udev->dev->subsystem);
|
||||
retval = udev_device_event(&rules, udev);
|
||||
if (retval == 0) {
|
||||
if (retval == 0 && !udev->ignore_device && udev_run) {
|
||||
struct name_entry *name_loop;
|
||||
|
||||
list_for_each_entry(name_loop, &udev->run_list, node)
|
||||
info("run: '%s'", name_loop->name);
|
||||
list_for_each_entry(name_loop, &udev->run_list, node) {
|
||||
char program[PATH_SIZE];
|
||||
|
||||
strlcpy(program, name_loop->name, sizeof(program));
|
||||
udev_rules_apply_format(udev, program, sizeof(program));
|
||||
info("run: '%s'", program);
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
|
Loading…
Reference in New Issue
Block a user