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
40cc2851
Commit
40cc2851
authored
Feb 19, 2005
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved deletion_count here so that we honor --max-delete in
delete_file().
parent
8174bc35
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
rsync.c
rsync.c
+11
-0
No files found.
rsync.c
View file @
40cc2851
...
@@ -36,6 +36,7 @@ extern int preserve_gid;
...
@@ -36,6 +36,7 @@ extern int preserve_gid;
extern
int
force_delete
;
extern
int
force_delete
;
extern
int
inplace
;
extern
int
inplace
;
extern
int
recurse
;
extern
int
recurse
;
extern
int
max_delete
;
extern
int
keep_dirlinks
;
extern
int
keep_dirlinks
;
extern
int
make_backups
;
extern
int
make_backups
;
extern
struct
stats
stats
;
extern
struct
stats
stats
;
...
@@ -53,6 +54,8 @@ void free_sums(struct sum_struct *s)
...
@@ -53,6 +54,8 @@ void free_sums(struct sum_struct *s)
}
}
int
deletion_count
=
0
;
/* used to implement --max-delete */
/*
/*
* delete a file or directory. If force_delete is set then delete
* delete a file or directory. If force_delete is set then delete
* recursively
* recursively
...
@@ -65,10 +68,14 @@ int delete_file(char *fname, int mode, int flags)
...
@@ -65,10 +68,14 @@ int delete_file(char *fname, int mode, int flags)
STRUCT_STAT
st
;
STRUCT_STAT
st
;
int
zap_dir
;
int
zap_dir
;
if
(
max_delete
&&
deletion_count
>=
max_delete
)
return
-
1
;
if
(
!
S_ISDIR
(
mode
))
{
if
(
!
S_ISDIR
(
mode
))
{
if
(
robust_unlink
(
fname
)
==
0
)
{
if
(
robust_unlink
(
fname
)
==
0
)
{
if
((
verbose
||
log_format
)
&&
!
(
flags
&
DEL_TERSE
))
if
((
verbose
||
log_format
)
&&
!
(
flags
&
DEL_TERSE
))
log_delete
(
fname
,
mode
);
log_delete
(
fname
,
mode
);
deletion_count
++
;
return
0
;
return
0
;
}
}
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
...
@@ -85,6 +92,7 @@ int delete_file(char *fname, int mode, int flags)
...
@@ -85,6 +92,7 @@ int delete_file(char *fname, int mode, int flags)
else
if
(
do_rmdir
(
fname
)
==
0
)
{
else
if
(
do_rmdir
(
fname
)
==
0
)
{
if
((
verbose
||
log_format
)
&&
!
(
flags
&
DEL_TERSE
))
if
((
verbose
||
log_format
)
&&
!
(
flags
&
DEL_TERSE
))
log_delete
(
fname
,
mode
);
log_delete
(
fname
,
mode
);
deletion_count
++
;
return
0
;
return
0
;
}
}
if
(
errno
==
ENOENT
)
if
(
errno
==
ENOENT
)
...
@@ -133,11 +141,14 @@ int delete_file(char *fname, int mode, int flags)
...
@@ -133,11 +141,14 @@ int delete_file(char *fname, int mode, int flags)
closedir
(
d
);
closedir
(
d
);
if
(
max_delete
&&
deletion_count
>=
max_delete
)
return
-
1
;
if
(
do_rmdir
(
fname
)
!=
0
&&
errno
!=
ENOENT
)
{
if
(
do_rmdir
(
fname
)
!=
0
&&
errno
!=
ENOENT
)
{
rsyserr
(
FERROR
,
errno
,
"delete_file: rmdir %s failed"
,
rsyserr
(
FERROR
,
errno
,
"delete_file: rmdir %s failed"
,
full_fname
(
fname
));
full_fname
(
fname
));
return
-
1
;
return
-
1
;
}
}
deletion_count
++
;
return
0
;
return
0
;
}
}
...
...
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