X-Git-Url: https://git.saurik.com/apple/file_cmds.git/blobdiff_plain/40bf83fed3260cbe00f8bd41f2f5a5f622d625be..293419153983bb06b87bfc1fb960e009b0d85f7b:/mv/mv.c?ds=sidebyside diff --git a/mv/mv.c b/mv/mv.c index c7df391..c1116d4 100644 --- a/mv/mv.c +++ b/mv/mv.c @@ -34,8 +34,9 @@ * SUCH DAMAGE. */ +#include #ifndef lint -static char const copyright[] = +__used static char const copyright[] = "@(#) Copyright (c) 1989, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ @@ -266,8 +267,8 @@ do_move(char *from, char *to) strmode(sb.st_mode, modep); (void)fprintf(stderr, "override %s%s%s/%s for %s? %s", modep + 1, modep[9] == ' ' ? "" : " ", - user_from_uid((unsigned long)sb.st_uid, 0), - group_from_gid((unsigned long)sb.st_gid, 0), to, YESNO); + user_from_uid(sb.st_uid, 0), + group_from_gid(sb.st_gid, 0), to, YESNO); ask = 1; } if (ask) { @@ -324,7 +325,8 @@ fastcopy(char *from, char *to, struct stat *sbp) static u_int blen; static char *bp; mode_t oldmode; - int nread, from_fd, to_fd; + ssize_t nread; + int from_fd, to_fd; if ((from_fd = open(from, O_RDONLY, 0)) < 0) { warn("%s", from); @@ -412,7 +414,7 @@ err: if (unlink(to)) * on a file that we copied, i.e., that we didn't create.) */ errno = 0; - if (fchflags(to_fd, (u_long)sbp->st_flags)) + if (fchflags(to_fd, (u_int)sbp->st_flags)) if (errno != ENOTSUP || sbp->st_flags != 0) warn("%s: set flags (was: 0%07o)", to, sbp->st_flags); @@ -440,6 +442,8 @@ int copy(char *from, char *to) { int pid, status; + + /* posix_spawn mv from to && rm from */ if ((pid = fork()) == 0) { execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to,