diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-06-23 22:50:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-07-04 23:12:38 +0200 |
commit | fd2de366e12373b1baf3217e42e75274b144ac5c (patch) | |
tree | 6d2685f2ce72c874837e1518e78bd6afaf7bc004 /src/getty-generator | |
parent | getty-generator: allow configuring additional gettys via credentials (diff) | |
download | systemd-fd2de366e12373b1baf3217e42e75274b144ac5c.tar.xz systemd-fd2de366e12373b1baf3217e42e75274b144ac5c.zip |
getty-generator: minor modernizations
Diffstat (limited to 'src/getty-generator')
-rw-r--r-- | src/getty-generator/getty-generator.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c index e327b375cd..24c35ae987 100644 --- a/src/getty-generator/getty-generator.c +++ b/src/getty-generator/getty-generator.c @@ -25,8 +25,7 @@ static const char *arg_dest = NULL; static bool arg_enabled = true; static int add_symlink(const char *fservice, const char *tservice) { - char *from, *to; - int r; + const char *from, *to; assert(fservice); assert(tservice); @@ -36,8 +35,7 @@ static int add_symlink(const char *fservice, const char *tservice) { (void) mkdir_parents_label(to, 0755); - r = symlink(from, to); - if (r < 0) { + if (symlink(from, to) < 0) { /* In case console=hvc0 is passed this will very likely result in EEXIST */ if (errno == EEXIST) return 0; @@ -281,7 +279,7 @@ static int run(const char *dest, const char *dest_early, const char *dest_late) p = path_join("/sys/class/tty", j); if (!p) - return -ENOMEM; + return log_oom(); if (access(p, F_OK) < 0) continue; |