Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 332902 Details for
Bug 447370
FreeBSD: cp -a (-P) fails when encountering broken symlinks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch from upstream
cp_dash_n_and_symlinks.patch (text/plain), 1.12 KB, created by
Michał Górny
on 2012-12-21 09:00:49 UTC
(
hide
)
Description:
Patch from upstream
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2012-12-21 09:00:49 UTC
Size:
1.12 KB
patch
obsolete
>diff --git a/bin/cp/cp.c b/bin/cp/cp.c >index 86dbb3c..24296de 100644 >--- a/bin/cp/cp.c >+++ b/bin/cp/cp.c >@@ -386,7 +386,8 @@ copy(char *argv[], enum op type, int fts_options) > } > > /* Not an error but need to remember it happened */ >- if (stat(to.p_path, &to_stat) == -1) >+ if ((!Rflag && stat(to.p_path, &to_stat) == -1) || >+ (Rflag && lstat(to.p_path, &to_stat) == -1)) > dne = 1; > else { > if (to_stat.st_dev == curr->fts_statp->st_dev && >@@ -481,7 +482,7 @@ copy(char *argv[], enum op type, int fts_options) > badcp = rval = 1; > break; > } >- if (vflag && !badcp) >+ if (vflag && !badcp && !nflag) > (void)printf("%s -> %s\n", curr->fts_path, to.p_path); > } > if (errno) >diff --git a/bin/cp/utils.c b/bin/cp/utils.c >index d729bd5..8cedeba 100644 >--- a/bin/cp/utils.c >+++ b/bin/cp/utils.c >@@ -266,6 +266,11 @@ copy_link(const FTSENT *p, int exists) > int len; > char llink[PATH_MAX]; > >+ if (exists && nflag) { >+ if (vflag) >+ printf("%s not overwritten\n", to.p_path); >+ return (0); >+ } > if ((len = readlink(p->fts_path, llink, sizeof(llink) - 1)) == -1) { > warn("readlink: %s", p->fts_path); > return (1);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 447370
: 332902 |
335060
|
374808
|
374810