mirror of
https://github.com/troglobit/finit.git
synced 2026-11-01 13:10:32 +00:00
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:
1 parent
a319e32438
commit
5404aa6037
5 files changed
+11
-43
No files matched your search
+2
-7
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user