mirror of
https://github.com/troglobit/finit.git
synced 2026-10-14 10:19:36 +00:00
tty: Refactor, remove useless runlevel argument
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
4cc3aed139
commit
963b736d8b
5 files changed
+10
-10
No files matched your search
+2
-2
@@ -434,8 +434,8 @@ int main(int argc, char* argv[])
|
||||
/* Enable silent mode before starting TTYs */
|
||||
log_silent();
|
||||
|
||||
/* Start TTYs */
|
||||
tty_runlevel(runlevel);
|
||||
/* Delayed start of TTYs at bootstrap */
|
||||
tty_runlevel();
|
||||
|
||||
/* Start new initctl API responder */
|
||||
api_init(&loop);
|
||||
|
||||
@@ -181,7 +181,7 @@ restart:
|
||||
|
||||
/* No TTYs run at bootstrap, they have a delayed start. */
|
||||
if (prevlevel > 0)
|
||||
tty_runlevel(runlevel);
|
||||
tty_runlevel();
|
||||
|
||||
sm->state = SM_RUNNING_STATE;
|
||||
break;
|
||||
|
||||
@@ -235,7 +235,7 @@ void tty_stop(finit_tty_t *tty)
|
||||
tty->pid = 0;
|
||||
}
|
||||
|
||||
int tty_enabled(finit_tty_t *tty, int runlevel)
|
||||
int tty_enabled(finit_tty_t *tty)
|
||||
{
|
||||
if (!tty)
|
||||
return 0;
|
||||
@@ -301,7 +301,7 @@ int tty_respawn(pid_t pid)
|
||||
/* Clear PID to be able to respawn it. */
|
||||
entry->data.pid = 0;
|
||||
|
||||
if (!tty_enabled(&entry->data, runlevel))
|
||||
if (!tty_enabled(&entry->data))
|
||||
tty_stop(&entry->data);
|
||||
else
|
||||
tty_start(&entry->data);
|
||||
@@ -310,12 +310,12 @@ int tty_respawn(pid_t pid)
|
||||
}
|
||||
|
||||
/* Start all TTYs that exist in the system and are allowed at this runlevel */
|
||||
void tty_runlevel(int runlevel)
|
||||
void tty_runlevel(void)
|
||||
{
|
||||
tty_node_t *entry;
|
||||
|
||||
LIST_FOREACH(entry, &tty_list, link) {
|
||||
if (!tty_enabled(&entry->data, runlevel))
|
||||
if (!tty_enabled(&entry->data))
|
||||
tty_stop(&entry->data);
|
||||
else
|
||||
tty_start(&entry->data);
|
||||
|
||||
@@ -54,9 +54,9 @@ size_t tty_num_active (void);
|
||||
tty_node_t *tty_find_by_pid (pid_t pid);
|
||||
void tty_start (finit_tty_t *tty);
|
||||
void tty_stop (finit_tty_t *tty);
|
||||
int tty_enabled (finit_tty_t *tty, int runlevel);
|
||||
int tty_enabled (finit_tty_t *tty);
|
||||
int tty_respawn (pid_t pid);
|
||||
void tty_runlevel (int runlevel);
|
||||
void tty_runlevel (void);
|
||||
|
||||
#endif /* FINIT_TTY_H_ */
|
||||
|
||||
|
||||
Reference in new issue
Block a user