diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-08-01 00:43:05 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-08-01 00:43:05 +0200 |
commit | f975e971accc4d50c73ae53167db3df7a7099cf2 (patch) | |
tree | ba7442194a0e6a13cb12645db19e90073f2cb80b /src/logind.c | |
parent | f786e80d7a76fd7446d142f610d62ea8c28ed902 (diff) |
load-fragment: speed up parsing by using a perfect hash table with configuration settings built by gperf
Diffstat (limited to 'src/logind.c')
-rw-r--r-- | src/logind.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/logind.c b/src/logind.c index 8b99065b23..ca48aa137f 100644 --- a/src/logind.c +++ b/src/logind.c @@ -1160,22 +1160,6 @@ int manager_run(Manager *m) { } static int manager_parse_config_file(Manager *m) { - - const ConfigItem items[] = { - { "NAutoVTs", config_parse_unsigned, 0, &m->n_autovts, "Login" }, - { "KillUserProcesses", config_parse_bool, 0, &m->kill_user_processes, "Login" }, - { "KillOnlyUsers", config_parse_strv, 0, &m->kill_only_users, "Login" }, - { "KillExcludeUsers", config_parse_strv, 0, &m->kill_exclude_users, "Login" }, - { "Controllers", config_parse_strv, 0, &m->controllers, "Login" }, - { "ResetControllers", config_parse_strv, 0, &m->reset_controllers, "Login" }, - { NULL, NULL, 0, NULL, NULL } - }; - - static const char * const sections[] = { - "Login", - NULL - }; - FILE *f; const char *fn; int r; @@ -1192,7 +1176,7 @@ static int manager_parse_config_file(Manager *m) { return -errno; } - r = config_parse(fn, f, sections, items, false, NULL); + r = config_parse(fn, f, "Login\0", config_item_perf_lookup, (void*) logind_gperf_lookup, false, m); if (r < 0) log_warning("Failed to parse configuration file: %s", strerror(-r)); |