tty: Refactor, remove useless runlevel argument

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2017-07-09 15:05:32 +02:00
parent 4cc3aed139
commit 963b736d8b
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -72,7 +72,7 @@ static void watcher(void *arg, int fd, int events)
snprintf(name, sizeof(name), "/dev/%s", notified->name);
entry = tty_find(name);
if (entry && tty_enabled(&entry->data, runlevel)) {
if (entry && tty_enabled(&entry->data)) {
if (notified->mask & IN_CREATE)
tty_start(&entry->data);
else if (entry->data.pid)
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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;
+4 -4
View File
@@ -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);
+2 -2
View File
@@ -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_ */