summaryrefslogtreecommitdiffstats
path: root/src/debug-generator
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-02-10 21:48:10 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-11 19:05:08 +0100
commitb3f9c17a6b361bf98e79a0228cdcb09afc40d1cc (patch)
tree1c607970840370d1588f41eb5e6387a240e08661 /src/debug-generator
parenttree-wide: propagate error in xxx_from-string() (diff)
downloadsystemd-b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc.tar.xz
systemd-b3f9c17a6b361bf98e79a0228cdcb09afc40d1cc.zip
tree-wide: use free_and_strdup_warn()
Diffstat (limited to 'src/debug-generator')
-rw-r--r--src/debug-generator/debug-generator.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c
index c6e4d79e3a..d9fccea5c9 100644
--- a/src/debug-generator/debug-generator.c
+++ b/src/debug-generator/debug-generator.c
@@ -68,27 +68,21 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
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;