summaryrefslogtreecommitdiffstats
path: root/bin/mv
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-05-20 05:00:16 +0000
committerkris <kris@FreeBSD.org>2001-05-20 05:00:16 +0000
commita9591ec95f9fb818528ccaf556ffd46bfc62e891 (patch)
tree026e76c1712bceb2a6110504bc7daa2f4c3168b1 /bin/mv
parent87fe6c7de032e5872bc35efed230a204f27fe2f8 (diff)
downloadFreeBSD-src-a9591ec95f9fb818528ccaf556ffd46bfc62e891.zip
FreeBSD-src-a9591ec95f9fb818528ccaf556ffd46bfc62e891.tar.gz
Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_t
warnings. MFC after: 1 week
Diffstat (limited to 'bin/mv')
-rw-r--r--bin/mv/mv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index fe7a2ed..996e19d 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -70,6 +70,7 @@ int fflg, iflg, vflg;
int copy __P((char *, char *));
int do_move __P((char *, char *));
int fastcopy __P((char *, char *, struct stat *));
+int main __P((int, char *[]));
void usage __P((void));
int
@@ -140,7 +141,7 @@ main(argc, argv)
warnx("%s: destination pathname too long", *argv);
rval = 1;
} else {
- memmove(endp, p, len + 1);
+ memmove(endp, p, (size_t)len + 1);
if (do_move(*argv, path))
rval = 1;
}
@@ -178,8 +179,8 @@ do_move(from, to)
strmode(sb.st_mode, modep);
(void)fprintf(stderr, "override %s%s%s/%s for %s? %s",
modep + 1, modep[9] == ' ' ? "" : " ",
- user_from_uid(sb.st_uid, 0),
- group_from_gid(sb.st_gid, 0), to, YESNO);
+ user_from_uid((unsigned long)sb.st_uid, 0),
+ group_from_gid((unsigned long)sb.st_gid, 0), to, YESNO);
ask = 1;
}
if (ask) {
@@ -247,7 +248,7 @@ fastcopy(from, to, sbp)
if (blen < sbp->st_blksize) {
if (bp != NULL)
free(bp);
- if ((bp = malloc(sbp->st_blksize)) == NULL) {
+ if ((bp = malloc((size_t)sbp->st_blksize)) == NULL) {
blen = 0;
warnx("malloc failed");
return (1);
@@ -262,8 +263,8 @@ fastcopy(from, to, sbp)
(void)close(from_fd);
return (1);
}
- while ((nread = read(from_fd, bp, blen)) > 0)
- if (write(to_fd, bp, nread) != nread) {
+ while ((nread = read(from_fd, bp, (size_t)blen)) > 0)
+ if (write(to_fd, bp, (size_t)nread) != nread) {
warn("%s", to);
goto err;
}
@@ -298,7 +299,7 @@ err: if (unlink(to))
* on a file that we copied, i.e., that we didn't create.)
*/
errno = 0;
- if (fchflags(to_fd, sbp->st_flags))
+ if (fchflags(to_fd, (u_long)sbp->st_flags))
if (errno != EOPNOTSUPP || sbp->st_flags != 0)
warn("%s: set flags (was: 0%07o)", to, sbp->st_flags);
OpenPOWER on IntegriCloud