Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
9533e15a
Commit
9533e15a
authored
May 22, 2003
by
J.W. Schultz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed write file to cope with partial writes by looping
until complete or errno is set. (John Van Essen)
parent
8dc74608
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
fileio.c
fileio.c
+11
-8
No files found.
fileio.c
View file @
9533e15a
...
...
@@ -69,19 +69,22 @@ static int write_sparse(int f,char *buf,size_t len)
return
len
;
}
/*
* write_file does not allow incomplete writes. It loops internally
* until len bytes are written or errno is set.
*/
int
write_file
(
int
f
,
char
*
buf
,
size_t
len
)
{
int
ret
=
0
;
if
(
!
sparse_files
)
{
return
write
(
f
,
buf
,
len
);
}
while
(
len
>
0
)
{
int
len1
=
MIN
(
len
,
SPARSE_WRITE_SIZE
);
int
r1
=
write_sparse
(
f
,
buf
,
len1
);
int
r1
;
if
(
sparse_files
)
{
int
len1
=
MIN
(
len
,
SPARSE_WRITE_SIZE
);
r1
=
write_sparse
(
f
,
buf
,
len1
);
}
else
{
r1
=
write
(
f
,
buf
,
len
);
}
if
(
r1
<=
0
)
{
if
(
ret
>
0
)
return
ret
;
return
r1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment