mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
run-generator: use generator_add_symlink()
This commit is contained in:
committed by
Mike Yuan
parent
6b892f85e2
commit
a308e97ad2
@@ -6,7 +6,6 @@
|
||||
#include "fd-util.h"
|
||||
#include "fileio.h"
|
||||
#include "generator.h"
|
||||
#include "glyph-util.h"
|
||||
#include "log.h"
|
||||
#include "proc-cmdline.h"
|
||||
#include "special.h"
|
||||
@@ -115,12 +114,11 @@ static int generate(void) {
|
||||
return log_error_errno(r, "Failed to create unit file %s: %m", p);
|
||||
|
||||
/* And now redirect default.target to our new target */
|
||||
p = strjoina(arg_dest, "/" SPECIAL_DEFAULT_TARGET);
|
||||
if (symlink("kernel-command-line.target", p) < 0)
|
||||
return log_error_errno(errno, "Failed to link unit file kernel-command-line.target %s %s: %m",
|
||||
glyph(GLYPH_ARROW_RIGHT), p);
|
||||
|
||||
return 0;
|
||||
return generator_add_symlink(
|
||||
arg_dest,
|
||||
SPECIAL_DEFAULT_TARGET,
|
||||
/* dep_type= */ NULL,
|
||||
"kernel-command-line.target");
|
||||
}
|
||||
|
||||
static int run(const char *dest, const char *dest_early, const char *dest_late) {
|
||||
|
||||
Reference in New Issue
Block a user