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
3ed8eafc
Commit
3ed8eafc
authored
Jan 30, 2006
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
The robust_rename() function now takes a "partialptr" arg that, if
non-NULL, will be used if we are forced to copy the file.
parent
d8b1c923
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
util.c
util.c
+10
-2
No files found.
util.c
View file @
3ed8eafc
...
...
@@ -377,8 +377,11 @@ int robust_unlink(const char *fname)
}
/* Returns 0 on successful rename, 1 if we successfully copied the file
* across filesystems, -2 if copy_file() failed, and -1 on other errors. */
int
robust_rename
(
const
char
*
from
,
const
char
*
to
,
int
mode
)
* across filesystems, -2 if copy_file() failed, and -1 on other errors.
* If partialptr is not NULL and we need to do a copy, copy the file into
* the active partial-dir instead of over the destination file. */
int
robust_rename
(
char
*
from
,
char
*
to
,
char
*
partialptr
,
int
mode
)
{
int
tries
=
4
;
...
...
@@ -394,6 +397,11 @@ int robust_rename(const char *from, const char *to, int mode)
break
;
#endif
case
EXDEV
:
if
(
partialptr
)
{
if
(
!
handle_partial_dir
(
partialptr
,
PDIR_CREATE
))
return
-
1
;
to
=
partialptr
;
}
if
(
copy_file
(
from
,
to
,
mode
)
!=
0
)
return
-
2
;
do_unlink
(
from
);
...
...
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