Skip to contentSkip to conversation

udev_rules_get_run confusion

DISCUSSION Andrey Borzenkov 2 participants 4 messages Jan 25, 2006 – Jan 26, 2006

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What this function does? As it is now it does *not* get called at all.

Is it leftover from the past or something for the future?

- -andrey
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD1+KmR6LMutpd94wRAll2AJ4mF32AMWM4x/fnpXIpQcfebeytdwCgwDbW CmfpPhVJAcAhUkKNeKy96Vg=qM8j
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 1 line · Andrey Borzenkov

What this function does? As it is now it does *not* get called at all.

  $ grep udev_rules_get_run *
  udev_device.c:          udev_rules_get_run(rules, udev);
  udev_device.c:  udev_rules_get_run(rules, udev);
  udev_rules.c:int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
  udev_rules.h:extern int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev);
Quoted 1 line

Is it leftover from the past or something for the future?

It is called for all events, that don't create a node and need to "name" a device. The logic is a bit different, if NAME is contained in a rule, that's why they are different functions. udev_rules_get_name() and udev_rules_get_run() could be merged, sure, if it would improve something, but I'm not sure about.

Thanks,
Kay

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Andrey Borzenkov
Quoted 3 lines · Kay Sievers
Quoted 1 line · Andrey Borzenkov

What this function does? As it is now it does *not* get called at all.

Oops I should never post that late. I missed this piece in previous patch. Trivial one-liner follows.

regards

-andrey

Subject: [PATCH] Remove udev_rules_apply_format from udev_rules_get_run

From: Andrey Borzenkov <[email protected]>

This removes now redundant substitution (otherwise it will be expanded twice).

---

 udev_rules.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
udev_rules.c +0 -1
index 90dc024..5d68728 100644
@@ -1082,7 +1082,6 @@ int udev_rules_get_run(struct udev_rules
 					name_list_cleanup(&udev->run_list);
 				}
 				strlcpy(program, key_val(rule, &rule->run), sizeof(program));
-				udev_rules_apply_format(udev, program, sizeof(program));
 				dbg("add run '%s'", program);
 				name_list_add(&udev->run_list, program, 0);
 				if (rule->run.operation == KEY_OP_ASSIGN_FINAL)
#3 lore raw
In reply to Andrey Borzenkov
Quoted 7 lines · Andrey Borzenkov
Quoted 3 lines · Kay Sievers
Quoted 1 line · Andrey Borzenkov

What this function does? As it is now it does *not* get called at all.

Oops I should never post that late. I missed this piece in previous patch. Trivial one-liner follows.

Thanks for the patch, I've removed the whole temporary variable now, which is not longer needed if we don't change the string.

Kay

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel