diff options
Diffstat (limited to 'toolbox/cp')
-rw-r--r-- | toolbox/cp/cp.c | 2 | ||||
-rw-r--r-- | toolbox/cp/utils.c | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/toolbox/cp/cp.c b/toolbox/cp/cp.c index bd3c70e..e666453 100644 --- a/toolbox/cp/cp.c +++ b/toolbox/cp/cp.c @@ -95,12 +95,14 @@ enum op { FILE_TO_FILE, FILE_TO_DIR, DIR_TO_DNE }; static int copy(char *[], enum op, int); +#ifndef ANDROID static void progress(int sig __unused) { pinfo++; } +#endif int cp_main(int argc, char *argv[]) diff --git a/toolbox/cp/utils.c b/toolbox/cp/utils.c index b682bbe..9d0390f 100644 --- a/toolbox/cp/utils.c +++ b/toolbox/cp/utils.c @@ -380,10 +380,11 @@ copy_special(struct stat *from_stat, int exists) int setfile(struct stat *fs, int fd) { - int rval, islink; + int rval = 0; +#ifndef ANDROID + int islink = S_ISLNK(fs->st_mode); +#endif - rval = 0; - islink = S_ISLNK(fs->st_mode); fs->st_mode &= S_ISUID | S_ISGID | S_IRWXU | S_IRWXG | S_IRWXO; /* @@ -401,13 +402,13 @@ setfile(struct stat *fs, int fd) fs->st_mode &= ~(S_ISUID | S_ISGID); } #ifdef ANDROID - if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) { + if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) { #else - if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) { + if (fd ? fchmod(fd, fs->st_mode) : lchmod(to.p_path, fs->st_mode)) { #endif - warn("chmod: %s", to.p_path); - rval = 1; - } + warn("chmod: %s", to.p_path); + rval = 1; + } #ifndef ANDROID if (!islink && !Nflag) { |