diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-07-05 15:24:41 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-07-05 15:24:41 +0200 |
commit | 8bd41f36f793f7fc208ef6beb4b2b84e35a5e728 (patch) | |
tree | d2a8d9f3ad291cf9f341cc87d87be80f435cfc30 /udevstart.c | |
parent | 6369839195d7572151d986ddc2050162e6879585 (diff) |
pack parsed rules list
This cuts down our 600 rules file to 98 kb instead of 1.9 Mb memory
or file-size with precompiled rules.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udevstart.c')
-rw-r--r-- | udevstart.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/udevstart.c b/udevstart.c index 22b781d52a..4ef92fd537 100644 --- a/udevstart.c +++ b/udevstart.c @@ -47,6 +47,7 @@ static const char *udev_run_str; static const char *udev_log_str; +static struct udev_rules rules; #ifdef USE_LOG void log_message(int priority, const char *format, ...) @@ -139,7 +140,7 @@ static int add_device(const char *path, const char *subsystem) dbg("sysfs_open_class_device_path failed"); return -1; } - udev_rules_get_name(&udev, class_dev); + udev_rules_get_name(&rules, &udev, class_dev); if (udev.ignore_device) { dbg("device event will be ignored"); goto exit; @@ -360,11 +361,12 @@ int main(int argc, char *argv[], char *envp[]) /* trigger timeout to prevent hanging processes */ alarm(ALARM_TIMEOUT); - udev_rules_init(); + udev_rules_init(&rules, 1); udev_scan_block(); udev_scan_class(); + udev_rules_close(&rules); logging_close(); return 0; } |