return 0;
}
- if (free_and_strdup(&s->bind_to_device, rvalue) < 0)
- return log_oom();
-
- return 0;
+ return free_and_strdup_warn(&s->bind_to_device, rvalue);
}
int config_parse_exec_input(
r = sscanf(value, "%m[0-9a-fA-F-]=%ms", &uuid, &uuid_value);
if (r != 2)
- return free_and_strdup(&arg_default_options, value) < 0 ? log_oom() : 0;
+ return free_and_strdup_warn(&arg_default_options, value);
if (warn_uuid_invalid(uuid, key))
return 0;
return 0;
n = strspn(value, ALPHANUMERICAL "-");
- if (value[n] != '=') {
- if (free_and_strdup(&arg_default_keyfile, value) < 0)
- return log_oom();
- return 0;
- }
+ if (value[n] != '=')
+ return free_and_strdup_warn(&arg_default_keyfile, value);
uuid = strndup(value, n);
if (!uuid)
else if (r > 0)
t = skip_dev_prefix(DEBUGTTY);
- if (free_and_strdup(&arg_debug_shell, t) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_debug_shell, t);
} else if (streq(key, "systemd.unit")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- r = free_and_strdup(&arg_default_unit, value);
- if (r < 0)
- return log_error_errno(r, "Failed to set default unit %s: %m", value);
+ return free_and_strdup_warn(&arg_default_unit, value);
} else if (!value) {
const char *target;
target = runlevel_to_target(key);
- if (target) {
- r = free_and_strdup(&arg_default_unit, target);
- if (r < 0)
- return log_error_errno(r, "Failed to set default unit %s: %m", target);
- }
+ if (target)
+ return free_and_strdup_warn(&arg_default_unit, target);
}
return 0;
}
log_info("Selected '%s'.", l[u-1]);
- if (free_and_strdup(ret, l[u-1]) < 0)
- return log_oom();
-
- return 0;
+ return free_and_strdup_warn(ret, l[u-1]);
}
if (!is_valid(p)) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_root_what, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_root_what, value);
} else if (streq(key, "rootfstype")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_root_fstype, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_root_fstype, value);
} else if (streq(key, "rootflags")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_root_hash, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_root_hash, value);
} else if (streq(key, "mount.usr")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_usr_what, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_usr_what, value);
} else if (streq(key, "mount.usrfstype")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_usr_fstype, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_usr_fstype, value);
} else if (streq(key, "mount.usrflags")) {
break;
case 't':
- if (free_and_strdup(&arg_mount_type, optarg) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&arg_mount_type, optarg);
+ if (r < 0)
+ return r;
break;
case 'o':
- if (free_and_strdup(&arg_mount_options, optarg) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&arg_mount_options, optarg);
+ if (r < 0)
+ return r;
break;
case ARG_OWNER: {
break;
case ARG_DESCRIPTION:
- if (free_and_strdup(&arg_description, optarg) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&arg_description, optarg);
+ if (r < 0)
+ return r;
break;
case 'p':
log_debug("Setting transient hostname: '%s'", strna(hostname));
- if (free_and_strdup(&m->dynamic_hostname, hostname) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&m->dynamic_hostname, hostname);
+ if (r < 0)
+ return r;
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting hostname later.");
assert(tz);
log_debug("Setting system timezone: '%s'", tz);
- if (free_and_strdup(&m->dynamic_timezone, tz) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&m->dynamic_timezone, tz);
+ if (r < 0)
+ return r;
if (!m->bus || sd_bus_is_ready(m->bus) <= 0) {
log_debug("Not connected to system bus, setting timezone later.");
return 0;
}
- if (free_and_strdup(s, empty_to_null(rvalue)) < 0)
- return log_oom();
-
- return 0;
+ return free_and_strdup_warn(s, empty_to_null(rvalue));
}
int config_parse_oom_score_adjust(
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_success_action, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_success_action, value);
} else if (proc_cmdline_key_streq(key, "systemd.run_failure_action")) {
if (proc_cmdline_value_missing(key, value))
return 0;
- if (free_and_strdup(&arg_failure_action, value) < 0)
- return log_oom();
+ return free_and_strdup_warn(&arg_failure_action, value);
}
return 0;
assert(rvalue);
assert(data);
- if (free_and_strdup(s, empty_to_null(rvalue)) < 0)
- return log_oom();
-
- return 0;
+ return free_and_strdup_warn(s, empty_to_null(rvalue));
}
int config_parse_path(
return 0;
}
- if (free_and_strdup(s, rvalue) < 0)
- return log_oom();
-
- return 0;
+ return free_and_strdup_warn(s, rvalue);
}
int config_parse_rx_tx_queues(
token->value);
break;
}
- if (free_and_strdup(&event->name, buf) < 0)
- return log_oom();
+ r = free_and_strdup_warn(&event->name, buf);
+ if (r < 0)
+ return r;
log_rule_debug(dev, rules, "NAME '%s'", event->name);
break;