Refactor run_getty() and run_getty2() into one

By moving the built-in getty to a stand-alone bundled getty we can now
refactor the old run_getty() functions into a single one.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2021-05-30 11:26:41 +02:00
1 parent a319e32438
commit 5404aa6037
5 files changed
+11 -43

No files matched your search

+2 -7
View File
@@ -1220,12 +1220,7 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
if (tty_parse_args(cmd, &tty))
return errno;
if (tty.cmd)
len += strlen(tty.cmd);
else
len += 3;
len += tty.num + 1;
len += strlen(tty.cmd) + tty.num + 1;
for (i = 0; i < tty.num; i++)
len += strlen(tty.args[i]) + 1;
@@ -1233,7 +1228,7 @@ int service_register(int type, char *cfg, struct rlimit rlimit[], char *file)
if (!line)
return errno;
snprintf(line, len, "%s", tty.cmd ?: "tty");
snprintf(line, len, "%s", tty.cmd);
for (i = 0; i < tty.num; i++) {
strlcat(line, " ", len);
strlcat(line, tty.args[i], len);