mirror of
https://github.com/SELinuxProject/selinux
synced 2025-01-02 03:32:13 +00:00
dispol: handle EOF in user interaction
Signed-off-by: Masatake YAMATO <yamato@redhat.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
eeb0a75119
commit
f8a076f1ca
@ -531,6 +531,8 @@ int main(int argc, char **argv)
|
||||
for (;;) {
|
||||
printf("\nCommand (\'m\' for menu): ");
|
||||
if (fgets(ans, sizeof(ans), stdin) == NULL) {
|
||||
if (feof(stdin))
|
||||
break;
|
||||
fprintf(stderr, "fgets failed at line %d: %s\n", __LINE__,
|
||||
strerror(errno));
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user