summaryrefslogtreecommitdiff
path: root/src/getty-generator/getty-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/getty-generator/getty-generator.c')
-rw-r--r--src/getty-generator/getty-generator.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c
index b2e4f52c3c..85600263f9 100644
--- a/src/getty-generator/getty-generator.c
+++ b/src/getty-generator/getty-generator.c
@@ -38,8 +38,8 @@ static int add_symlink(const char *fservice, const char *tservice) {
assert(fservice);
assert(tservice);
- asprintf(&from, SYSTEM_DATA_UNIT_PATH "/%s", fservice);
- asprintf(&to, "%s/getty.target.wants/%s", arg_dest, tservice);
+ from = strappend(SYSTEM_DATA_UNIT_PATH "/", fservice);
+ to = join(arg_dest,"/getty.target.wants/", tservice, NULL);
if (!from || !to) {
log_error("Out of memory");
@@ -99,20 +99,20 @@ int main(int argc, char *argv[]) {
char *active;
const char *j;
- if (argc > 2) {
- log_error("This program takes one or no arguments.");
+ if (argc > 1 && argc != 4) {
+ log_error("This program takes three or no arguments.");
return EXIT_FAILURE;
}
+ if (argc > 1)
+ arg_dest = argv[1];
+
log_set_target(LOG_TARGET_SAFE);
log_parse_environment();
log_open();
umask(0022);
- if (argc > 1)
- arg_dest = argv[1];
-
if (detect_container(NULL) > 0) {
log_debug("Automatically adding console shell.");