diff --git a/bin/mv/mv.c b/bin/mv/mv.c index 68bebe2036ee..9df45838944b 100644 --- a/bin/mv/mv.c +++ b/bin/mv/mv.c @@ -1,4 +1,4 @@ -/* $NetBSD: mv.c,v 1.38 2007/02/15 09:57:16 rillig Exp $ */ +/* $NetBSD: mv.c,v 1.39 2008/01/16 11:43:34 hubertf Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: mv.c,v 1.38 2007/02/15 09:57:16 rillig Exp $"); +__RCSID("$NetBSD: mv.c,v 1.39 2008/01/16 11:43:34 hubertf Exp $"); #endif #endif /* not lint */ @@ -98,7 +98,6 @@ main(int argc, char *argv[]) case 'v': vflg = 1; break; - case '?': default: usage(); } @@ -273,6 +272,8 @@ fastcopy(char *from, char *to, struct stat *sbp) } if (!blen && !(bp = malloc(blen = sbp->st_blksize))) { warn(NULL); + (void)close(from_fd); + (void)close(to_fd); return (1); } while ((nread = read(from_fd, bp, blen)) > 0) @@ -333,7 +334,8 @@ err: if (unlink(to)) int copy(char *from, char *to) { - int pid, status; + pid_t pid; + int status; if ((pid = vfork()) == 0) { execl(_PATH_CP, "mv", vflg ? "-PRpv" : "-PRp", "--", from, to, NULL);