summaryrefslogtreecommitdiffstats
path: root/src/debug-generator
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-08-04 08:25:53 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-08-04 12:32:42 +0200
commitbd6c95c00b7a25b4d360bac22d3a3bc54132c415 (patch)
tree888942c99777c0956c4d863098ebd5ffff30a88d /src/debug-generator
parenttpm2: use CreatePrimary() to create primary keys instead of Create() (diff)
downloadsystemd-bd6c95c00b7a25b4d360bac22d3a3bc54132c415.tar.xz
systemd-bd6c95c00b7a25b4d360bac22d3a3bc54132c415.zip
debug-generator: Use generator_add_symlink()
Diffstat (limited to 'src/debug-generator')
-rw-r--r--src/debug-generator/debug-generator.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/debug-generator/debug-generator.c b/src/debug-generator/debug-generator.c
index 1fe2b56810..8a474c58cf 100644
--- a/src/debug-generator/debug-generator.c
+++ b/src/debug-generator/debug-generator.c
@@ -112,7 +112,7 @@ static int generate_wants_symlinks(void) {
int r = 0;
STRV_FOREACH(u, arg_wants) {
- _cleanup_free_ char *p = NULL, *f = NULL;
+ _cleanup_free_ char *f = NULL;
const char *target;
/* This should match what do_queue_default_job() in core/main.c does. */
@@ -123,20 +123,13 @@ static int generate_wants_symlinks(void) {
else
target = SPECIAL_DEFAULT_TARGET;
- p = strjoin(arg_dest, "/", target, ".wants/", *u);
- if (!p)
- return log_oom();
-
f = path_join(SYSTEM_DATA_UNIT_DIR, *u);
if (!f)
return log_oom();
- (void) mkdir_parents_label(p, 0755);
-
- if (symlink(f, p) < 0)
- r = log_error_errno(errno,
- "Failed to create wants symlink %s: %m",
- p);
+ r = generator_add_symlink(arg_dest, target, "wants", f);
+ if (r < 0)
+ return r;
}
return r;