aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiang Fan <sfanxiang@gmail.com>2017-02-01 15:50:23 +0000
committerXiang Fan <sfanxiang@gmail.com>2017-02-01 15:51:22 +0000
commit39eedbfb3d53fcbaa28caf4e32e360245c40b2e2 (patch)
tree1c7d0b8bdfbddf0fa9b13769fe5af23a86463965
parent9f276156d59fbb59291308e6539d994a4aa19de9 (diff)
downloadandroid_external_toybox-cm-14.1_old.tar.gz
android_external_toybox-cm-14.1_old.tar.bz2
android_external_toybox-cm-14.1_old.zip
cp: set rc properlycm-14.1_old
This fixes the failure when going through symlinks. Change-Id: If0e2959356312b44ad9e93a2b35f4d60acb52777
-rw-r--r--toys/posix/cp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/cp.c b/toys/posix/cp.c
index 6e035f77..0dd63a7d 100644
--- a/toys/posix/cp.c
+++ b/toys/posix/cp.c
@@ -315,7 +315,7 @@ int cp_node(struct dirtree *try)
// permission bits already correct for mknod and don't apply to symlink
// If we can't get a filehandle to the actual object, use racy functions
if (fdout == AT_FDCWD)
- fchownat(cfd, catch, try->st.st_uid, try->st.st_gid,
+ rc = fchownat(cfd, catch, try->st.st_uid, try->st.st_gid,
AT_SYMLINK_NOFOLLOW);
else rc = fchown(fdout, try->st.st_uid, try->st.st_gid);
if (rc && !geteuid()) {