Commit 746a86a2 authored by Wren Turkal's avatar Wren Turkal
Browse files

Add unlocked variation of fwide function.


Signed-off-by: Wren Turkal's avatarWren Turkal <wt@penguintechs.org>
parent b623e245
......@@ -174,15 +174,19 @@ impl FILE {
}
pub fn try_set_orientation(&mut self, mode: c_int) -> c_int {
let mut stream = self.lock();
if stream.0.orientation == 0 {
stream.0.orientation = match mode {
let stream = self.lock();
stream.0.try_set_orientation_unlocked(mode)
}
pub fn try_set_orientation_unlocked(&mut self, mode: c_int) -> c_int {
if self.orientation == 0 {
self.orientation = match mode {
1..=i32::MAX => 1,
i32::MIN..=-1 => -1,
0 => stream.0.orientation,
0 => self.orientation,
};
}
stream.0.orientation
self.orientation
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment