]> git.saurik.com Git - apple/file_cmds.git/blobdiff - mv/mv.c
file_cmds-251.tar.gz
[apple/file_cmds.git] / mv / mv.c
diff --git a/mv/mv.c b/mv/mv.c
index c7df391e75d59f4ae5f44207be552602f4648486..c1116d442955ee39cee9eb08d3abccfdb71bc84f 100644 (file)
--- a/mv/mv.c
+++ b/mv/mv.c
@@ -34,8 +34,9 @@
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #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,