diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-08-04 08:25:53 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-08-04 12:32:42 +0200 |
commit | bd6c95c00b7a25b4d360bac22d3a3bc54132c415 (patch) | |
tree | 888942c99777c0956c4d863098ebd5ffff30a88d /src/debug-generator | |
parent | tpm2: use CreatePrimary() to create primary keys instead of Create() (diff) | |
download | systemd-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.c | 15 |
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; |