Make freopen reset the stream orientation.

Signed-off-by: Wren Turkal <wt@penguintechs.org>
This commit is contained in:
Wren Turkal
2020-07-08 05:43:01 -07:00
parent 865b7962a1
commit b623e245c0
3 changed files with 30 additions and 1 deletions
+1
View File
@@ -519,6 +519,7 @@ pub unsafe extern "C" fn freopen(
stream.flags = (stream.flags & constants::F_PERM) | new.flags;
fclose(new);
}
stream.orientation = 0;
funlockfile(stream);
stream
}