mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Refactor TTY code to honor runlevels and use I/O plugin to watch /dev
Add support for runlevels to tty command and support for reading baud rate and TERM variable from finit.conf. The tty-watcher thread has been converted to a standard I/O plugin. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
f97aab4699
commit
0f60aa2289
13 files changed
+391
-144
No files matched your search
@@ -505,7 +505,7 @@ int run_interactive(char *cmd, char *fmt, ...)
|
||||
return status;
|
||||
}
|
||||
|
||||
pid_t run_getty(char *cmd, int console)
|
||||
pid_t run_getty(char *cmd, char *args[], int console)
|
||||
{
|
||||
pid_t pid = fork();
|
||||
|
||||
@@ -557,7 +557,7 @@ pid_t run_getty(char *cmd, int console)
|
||||
if (fexist(SYNC_STOPPED))
|
||||
continue;
|
||||
|
||||
run(cmd);
|
||||
execv(cmd, args);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
@@ -657,6 +657,13 @@ void chomp(char *str)
|
||||
*x = 0;
|
||||
}
|
||||
|
||||
/* Signal safe sleep ... we get a lot of SIGCHLD at reboot */
|
||||
void do_sleep(unsigned int sec)
|
||||
{
|
||||
while ((sec = sleep(sec)))
|
||||
;
|
||||
}
|
||||
|
||||
void set_hostname(char *hostname)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
Reference in new issue
Block a user