mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Refactor, rename local variables
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
560adb2065
commit
8505db24b7
1 file changed
+11
-11
@@ -193,31 +193,31 @@ int tty_check(char *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tty_start(finit_tty_t *fitty)
|
void tty_start(finit_tty_t *tty)
|
||||||
{
|
{
|
||||||
int is_console = 0;
|
int is_console = 0;
|
||||||
char *tty;
|
char *dev;
|
||||||
|
|
||||||
if (fitty->pid) {
|
if (tty->pid) {
|
||||||
_d("%s: TTY already active", fitty->name);
|
_d("%s: TTY already active", tty->name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tty = canonicalize(fitty->name);
|
dev = canonicalize(tty->name);
|
||||||
if (!tty) {
|
if (!dev) {
|
||||||
_d("%s: Cannot find TTY device: %s", fitty->name, strerror(errno));
|
_d("%s: Cannot find TTY device: %s", tty->name, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (console && !strcmp(tty, console))
|
if (console && !strcmp(dev, console))
|
||||||
is_console = 1;
|
is_console = 1;
|
||||||
|
|
||||||
if (tty_check(tty)) {
|
if (tty_check(dev)) {
|
||||||
_d("%s: Not a valid TTY: %s", tty, strerror(errno));
|
_d("%s: Not a valid TTY: %s", dev, strerror(errno));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fitty->pid = run_getty(tty, fitty->baud, fitty->term, is_console);
|
tty->pid = run_getty(dev, tty->baud, tty->term, is_console);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tty_stop(finit_tty_t *tty)
|
void tty_stop(finit_tty_t *tty)
|
||||||
|
|||||||
Reference in new issue
Block a user