puts("\r\nSystem closed for routine maintenance\r");
fclose(fp);
- fflush(NULL);
+ fflush_all();
/* Users say that they do need this prior to exit: */
tcdrain(STDOUT_FILENO);
exit(EXIT_FAILURE);
return;
if (get_default_context(username, NULL, user_sid)) {
- bb_error_msg_and_die("cannot get SID for %s", username);
+ bb_error_msg_and_die("can't get SID for %s", username);
}
if (getfilecon(full_tty, &old_tty_sid) < 0) {
bb_perror_msg_and_die("getfilecon(%s) failed", full_tty);
/* skip whitespace */
do {
c = getchar();
- if (c == EOF) exit(EXIT_FAILURE);
+ if (c == EOF)
+ exit(EXIT_FAILURE);
if (c == '\n') {
- if (!--cntdown) exit(EXIT_FAILURE);
+ if (!--cntdown)
+ exit(EXIT_FAILURE);
goto prompt;
}
- } while (isspace(c));
+ } while (isspace(c)); /* maybe isblank? */
*buf++ = c;
if (!fgets(buf, size_buf-2, stdin))
exit(EXIT_FAILURE);
if (!strchr(buf, '\n'))
exit(EXIT_FAILURE);
- while (isgraph(*buf)) buf++;
+ while ((unsigned char)*buf > ' ')
+ buf++;
*buf = '\0';
}
fd = open(bb_path_motd_file, O_RDONLY);
if (fd >= 0) {
- fflush(stdout);
+ fflush_all();
bb_copyfd_eof(fd, STDOUT_FILENO);
close(fd);
}
* We don't want to block here */
ndelay_on(1);
printf("\r\nLogin timed out after %d seconds\r\n", TIMEOUT);
- fflush(stdout);
+ fflush_all();
/* unix API is brain damaged regarding O_NONBLOCK,
* we should undo it, or else we can affect other processes */
ndelay_off(1);