mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 03:38:31 +00:00
Let signals interrupt fgets unless SA_RESTART set (#1152)
This commit is contained in:
parent
181cd4cbe8
commit
8f6bc9dabc
2 changed files with 139 additions and 5 deletions
|
@ -57,11 +57,7 @@ char *fgets_unlocked(char *s, int size, FILE *f) {
|
|||
break;
|
||||
} else {
|
||||
if ((c = fgetc_unlocked(f)) == -1) {
|
||||
if (ferror_unlocked(f) == EINTR) {
|
||||
continue;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
*p++ = c & 255;
|
||||
if (c == '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue