diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-08 18:58:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-12 11:07:55 +0100 |
commit | 548f69375e05e048549b24118aebcd8a41451691 (patch) | |
tree | b35b92221a4948e736a3eea7b4c6ee1b0bd87660 /src/sysctl | |
parent | 46e16b347f83d809ed3d34f26286f580dfd086ce (diff) | |
download | systemd-548f69375e05e048549b24118aebcd8a41451691.tar.gz |
tree-wide: use path_hash_ops instead of string_hash_ops whenever we key by a path
Let's make use of our new hash_ops!
Diffstat (limited to 'src/sysctl')
-rw-r--r-- | src/sysctl/sysctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c index a1dc95b2bb..d97656d6fe 100644 --- a/src/sysctl/sysctl.c +++ b/src/sysctl/sysctl.c @@ -110,19 +110,19 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign _cleanup_free_ char *l = NULL; void *v; int k; + k = read_line(f, LONG_LINE_MAX, &l); if (k == 0) break; - if (k < 0) return log_error_errno(k, "Failed to read file '%s', ignoring: %m", path); c++; p = strstrip(l); - if (!*p) - continue; + if (isempty(p)) + continue; if (strchr(COMMENTS "\n", *p)) continue; @@ -261,7 +261,7 @@ int main(int argc, char *argv[]) { umask(0022); - sysctl_options = ordered_hashmap_new(&string_hash_ops); + sysctl_options = ordered_hashmap_new(&path_hash_ops); if (!sysctl_options) { r = log_oom(); goto finish; |