/* vi: set sw=4 ts=4: */
/*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#include "libbb.h"
#include <syslog.h>
};
char *fromhost;
char username[USERNAME_SIZE];
- const char *tmp;
+ const char *shell;
int run_by_root;
unsigned opt;
int count = 0;
while (1) {
/* flush away any type-ahead (as getty does) */
- ioctl(0, TCFLSH, TCIFLUSH);
+ tcflush(0, TCIFLUSH);
if (!username[0])
get_username_or_die(username, sizeof(username));
run_login_script(pw, full_tty);
change_identity(pw);
- tmp = pw->pw_shell;
- if (!tmp || !*tmp)
- tmp = DEFAULT_SHELL;
- setup_environment(tmp,
+ shell = pw->pw_shell;
+ if (!shell || !shell[0])
+ shell = DEFAULT_SHELL;
+ setup_environment(shell,
(!(opt & LOGIN_OPT_p) * SETUP_ENV_CLEARENV) + SETUP_ENV_CHANGEENV,
pw);
signal(SIGINT, SIG_DFL);
/* Exec login shell with no additional parameters */
- run_shell(tmp, 1, NULL, NULL);
+ run_shell(shell, 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */
}