Skip to content

Commit

Permalink
Minor, coding style fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Feb 23, 2025
1 parent 6552cda commit a677b94
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ int run(char *cmd, char *log)
int run_interactive(char *cmd, char *fmt, ...)
{
int status, oldout = 1, olderr = 2;
char line[LINE_SIZE];
FILE *fp;

if (!cmd) {
Expand Down Expand Up @@ -244,6 +243,7 @@ int run_interactive(char *cmd, char *fmt, ...)

/* Dump any results of cmd on stderr after we've printed [ OK ] or [FAIL] */
if (fp && !debug) {
char line[LINE_SIZE];
size_t len, written;

rewind(fp);
Expand Down Expand Up @@ -281,7 +281,7 @@ int exec_runtask(char *cmd, char *args[])
return execvp(_PATH_BSHELL, argv);
}

static void prepare_tty(char *tty, speed_t speed, char *procname, struct rlimit rlimit[])
static void prepare_tty(char *tty, speed_t speed, const char *procname, struct rlimit rlimit[])
{
char name[80];
int fd, dummy;
Expand Down Expand Up @@ -351,7 +351,7 @@ static int activate_console(int noclear, int nowait)
dprint(STDERR_FILENO, clr, strlen(clr));
dprint(STDERR_FILENO, msg, strlen(msg));
while ((rc = read(STDIN_FILENO, &ch, 1)) > 0 && ch != '\r' && ch != '\n')
continue;
;

/* On any error (likely EINTR), we avoid starting getty */
if (rc == -1)
Expand Down
5 changes: 3 additions & 2 deletions src/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,9 @@ int tty_parse_args(struct tty *tty, char *cmd, char **args)
return errno = EINVAL;
}

dbg("Registering %s getty on TTY %s at %s baud with term %s", tty->cmd ? "external" : "built-in",
tty->dev, tty->baud ?: "0", tty->term ?: "N/A");
dbg("Registering %s getty on TTY %s at %s baud with term %s",
tty->cmd ? "external" : "built-in",
tty->dev, tty->baud ?: "0", tty->term ?: "N/A");

/* Built-in getty now comes as standalone program */
if (!tty->cmd) {
Expand Down

0 comments on commit a677b94

Please sign in to comment.