Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
relibc
Commits
dfa3845c
Verified
Commit
dfa3845c
authored
6 years ago
by
jD91mZM2
Browse files
Options
Downloads
Patches
Plain Diff
Make fread/fwrite retry their respective operations
parent
6dcc8ee8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1407
failed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/header/stdio/mod.rs
+14
-6
14 additions, 6 deletions
src/header/stdio/mod.rs
with
14 additions
and
6 deletions
src/header/stdio/mod.rs
+
14
−
6
View file @
dfa3845c
...
...
@@ -387,10 +387,14 @@ pub extern "C" fn fread(ptr: *mut c_void, size: size_t, count: size_t, stream: *
ptr
as
*
mut
u8
,
size
as
usize
*
count
as
usize
)
};
match
stream
.read
(
buf
)
{
Ok
(
bytes
)
=>
(
bytes
as
usize
/
size
as
usize
)
as
size_t
,
Err
(
_
)
=>
0
let
mut
read
=
0
;
while
read
<
buf
.len
()
{
match
stream
.read
(
&
mut
buf
[
read
..
])
{
Ok
(
0
)
|
Err
(
_
)
=>
break
,
Ok
(
n
)
=>
read
+=
n
}
}
(
read
/
size
as
usize
)
as
size_t
}
#[no_mangle]
...
...
@@ -512,10 +516,14 @@ pub extern "C" fn fwrite(ptr: *const c_void, size: usize, count: usize, stream:
ptr
as
*
mut
u8
,
size
as
usize
*
count
as
usize
)
};
match
stream
.write
(
buf
)
{
Ok
(
bytes
)
=>
(
bytes
as
usize
/
size
as
usize
)
as
size_t
,
Err
(
_
)
=>
0
let
mut
written
=
0
;
while
written
<
buf
.len
()
{
match
stream
.write
(
&
mut
buf
[
written
..
])
{
Ok
(
0
)
|
Err
(
_
)
=>
break
,
Ok
(
n
)
=>
written
+=
n
}
}
(
written
/
size
as
usize
)
as
size_t
}
/// Get a single char from a stream
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment