mirror of
https://github.com/troglobit/finit.git
synced 2026-10-01 05:22:48 +07:00
Refactor tty handling to use service backend enabling conditions etc.
Initial refactor of the tty implementation to use the service/run/task general backend. This enables all the features of services also for ttys, except logging because it makes no sense. Work in progress: - plugins/tty.c does not work anymore, could possibly be removed in favor of usinga (a new) condition instead (if-tty-exists) - fallback tty does not work anymore, should we remove it, or can we handle it as an optional built-in with (a new) condition? - @console does not work anymore, needs to generate N cloned services Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+4
-2
@@ -55,17 +55,19 @@ static void setup(void)
|
||||
|
||||
static void do_tty(char *tty, size_t len, int creat)
|
||||
{
|
||||
#if 0
|
||||
char name[len + 6];
|
||||
struct tty *entry;
|
||||
svc_t *entry;
|
||||
|
||||
snprintf(name, sizeof(name), "/dev/%s", tty);
|
||||
entry = tty_find(name);
|
||||
entry = svc_find_by_tty(name);
|
||||
if (entry && tty_enabled(entry)) {
|
||||
if (creat)
|
||||
tty_start(entry);
|
||||
else if (entry->pid)
|
||||
tty_stop(entry);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void watcher(void *arg, int fd, int events)
|
||||
|
||||
Reference in New Issue
Block a user