mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-07 09:00:28 +00:00
cp: Clarify an obscure comment.
MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D44805
This commit is contained in:
parent
2e850b832f
commit
64d6925d19
10
bin/cp/cp.c
10
bin/cp/cp.c
|
@ -452,13 +452,19 @@ copy(char *argv[], enum op type, int fts_options, struct stat *root_stat)
|
||||||
|
|
||||||
switch (curr->fts_statp->st_mode & S_IFMT) {
|
switch (curr->fts_statp->st_mode & S_IFMT) {
|
||||||
case S_IFLNK:
|
case S_IFLNK:
|
||||||
/* Catch special case of a non-dangling symlink. */
|
|
||||||
if ((fts_options & FTS_LOGICAL) ||
|
if ((fts_options & FTS_LOGICAL) ||
|
||||||
((fts_options & FTS_COMFOLLOW) &&
|
((fts_options & FTS_COMFOLLOW) &&
|
||||||
curr->fts_level == 0)) {
|
curr->fts_level == 0)) {
|
||||||
|
/*
|
||||||
|
* We asked FTS to follow links but got
|
||||||
|
* here anyway, which means the target is
|
||||||
|
* nonexistent or inaccessible. Let
|
||||||
|
* copy_file() deal with the error.
|
||||||
|
*/
|
||||||
if (copy_file(curr, dne))
|
if (copy_file(curr, dne))
|
||||||
badcp = rval = 1;
|
badcp = rval = 1;
|
||||||
} else {
|
} else {
|
||||||
|
/* Copy the link. */
|
||||||
if (copy_link(curr, !dne))
|
if (copy_link(curr, !dne))
|
||||||
badcp = rval = 1;
|
badcp = rval = 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue