|
Lines 47-52
int ask_password_tty(
Link Here
|
| 47 |
int r, ttyfd = -1, notify = -1; |
47 |
int r, ttyfd = -1, notify = -1; |
| 48 |
struct pollfd pollfd[2]; |
48 |
struct pollfd pollfd[2]; |
| 49 |
bool reset_tty = false; |
49 |
bool reset_tty = false; |
|
|
50 |
bool splash_silent = false; |
| 51 |
FILE *procsplash = NULL; |
| 52 |
char *line = NULL; |
| 50 |
enum { |
53 |
enum { |
| 51 |
POLL_TTY, |
54 |
POLL_TTY, |
| 52 |
POLL_INOTIFY |
55 |
POLL_INOTIFY |
|
Lines 90-95
int ask_password_tty(
Link Here
|
| 90 |
} |
93 |
} |
| 91 |
|
94 |
|
| 92 |
reset_tty = true; |
95 |
reset_tty = true; |
|
|
96 |
procsplash = fopen("/proc/splash", "r+"); |
| 97 |
if (procsplash) { |
| 98 |
getline(&line, &p, procsplash); |
| 99 |
p = 0; /* reset, just to make sure */ |
| 100 |
if (line && |
| 101 |
(strstr(line, "on\n") == line + strlen(line) - 3) && |
| 102 |
(strstr(line, "silent") != NULL)) { |
| 103 |
splash_silent = true; |
| 104 |
rewind(procsplash); |
| 105 |
fprintf(procsplash, "verbose\n"); |
| 106 |
fflush(procsplash); |
| 107 |
} |
| 108 |
} |
| 93 |
} |
109 |
} |
| 94 |
|
110 |
|
| 95 |
zero(pollfd); |
111 |
zero(pollfd); |
|
Lines 201-206
finish:
Link Here
|
| 201 |
close_nointr_nofail(ttyfd); |
217 |
close_nointr_nofail(ttyfd); |
| 202 |
} |
218 |
} |
| 203 |
|
219 |
|
|
|
220 |
if (splash_silent) { /* only set if procsplash != NULL */ |
| 221 |
rewind(procsplash); |
| 222 |
fprintf(procsplash, "silent\n"); |
| 223 |
fclose(procsplash); |
| 224 |
} |
| 225 |
|
| 204 |
return r; |
226 |
return r; |
| 205 |
} |
227 |
} |
| 206 |
|
228 |
|
| 207 |
- |
|
|