fileio: drop "newline" parameter for env file parsers
Now that we don't (mis-)use the env file parser to parse kernel command lines there's no need anymore to override the used newline character set. Let's hence drop the argument and just "\n\r" always. This nicely simplifies our code.
This commit is contained in:
@@ -339,7 +339,7 @@ int show_cgroup_get_path_and_warn(
|
||||
const char *m;
|
||||
|
||||
m = strjoina("/run/systemd/machines/", machine);
|
||||
r = parse_env_file(NULL, m, NEWLINE, "SCOPE", &unit, NULL);
|
||||
r = parse_env_file(NULL, m, "SCOPE", &unit, NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to load machine data: %m");
|
||||
|
||||
|
||||
@@ -471,7 +471,7 @@ static int condition_test_needs_update(Condition *c) {
|
||||
uint64_t timestamp;
|
||||
int r;
|
||||
|
||||
r = parse_env_file(NULL, p, NULL, "TIMESTAMP_NSEC", ×tamp_str, NULL);
|
||||
r = parse_env_file(NULL, p, "TIMESTAMP_NSEC", ×tamp_str, NULL);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to parse timestamp file '%s', using mtime: %m", p);
|
||||
return true;
|
||||
|
||||
@@ -1333,14 +1333,14 @@ int dissected_image_acquire_metadata(DissectedImage *m) {
|
||||
}
|
||||
|
||||
case META_MACHINE_INFO:
|
||||
r = load_env_file_pairs(f, "machine-info", NULL, &machine_info);
|
||||
r = load_env_file_pairs(f, "machine-info", &machine_info);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to read /etc/machine-info: %m");
|
||||
|
||||
break;
|
||||
|
||||
case META_OS_RELEASE:
|
||||
r = load_env_file_pairs(f, "os-release", NULL, &os_release);
|
||||
r = load_env_file_pairs(f, "os-release", &os_release);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to read OS release file: %m");
|
||||
|
||||
|
||||
@@ -1114,7 +1114,7 @@ int image_read_metadata(Image *i) {
|
||||
if (r < 0 && r != -ENOENT)
|
||||
log_debug_errno(r, "Failed to chase /etc/machine-info in image %s: %m", i->name);
|
||||
else if (r >= 0) {
|
||||
r = load_env_file_pairs(NULL, path, NULL, &machine_info);
|
||||
r = load_env_file_pairs(NULL, path, &machine_info);
|
||||
if (r < 0)
|
||||
log_debug_errno(r, "Failed to parse machine-info data of %s: %m", i->name);
|
||||
}
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ static void load_testdata_env(void) {
|
||||
dirname(s);
|
||||
|
||||
envpath = path_join(NULL, s, "systemd-runtest.env");
|
||||
if (load_env_file_pairs(NULL, envpath, NULL, &pairs) < 0)
|
||||
if (load_env_file_pairs(NULL, envpath, &pairs) < 0)
|
||||
return;
|
||||
|
||||
STRV_FOREACH_PAIR(k, v, pairs)
|
||||
|
||||
@@ -29,7 +29,7 @@ int udev_parse_config_full(
|
||||
_cleanup_free_ char *log_val = NULL, *children_max = NULL, *exec_delay = NULL, *event_timeout = NULL, *resolve_names = NULL;
|
||||
int r;
|
||||
|
||||
r = parse_env_file(NULL, "/etc/udev/udev.conf", NEWLINE,
|
||||
r = parse_env_file(NULL, "/etc/udev/udev.conf",
|
||||
"udev_log", &log_val,
|
||||
"children_max", &children_max,
|
||||
"exec_delay", &exec_delay,
|
||||
|
||||
Reference in New Issue
Block a user