CVS commit: [netbsd-7] src/bin/cp

2016-03-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  6 18:41:53 UTC 2016

Modified Files:
src/bin/cp [netbsd-7]: utils.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1130):
bin/cp/utils.c: revision 1.45
for display in the (post) SIGINFO handler use off_t not size_t for
file sizes.  fixes incorrect reporting errors on 32 bit platforms
with >4GB file sizes.


To generate a diff of this commit:
cvs rdiff -u -r1.42.4.1 -r1.42.4.2 src/bin/cp/utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.42.4.1 src/bin/cp/utils.c:1.42.4.2
--- src/bin/cp/utils.c:1.42.4.1	Thu Mar  3 14:30:52 2016
+++ src/bin/cp/utils.c	Sun Mar  6 18:41:53 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.42.4.1 2016/03/03 14:30:52 martin Exp $ */
+/* $NetBSD: utils.c,v 1.42.4.2 2016/03/06 18:41:53 martin Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.42.4.1 2016/03/03 14:30:52 martin Exp $");
+__RCSID("$NetBSD: utils.c,v 1.42.4.2 2016/03/06 18:41:53 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -77,17 +77,18 @@ set_utimes(const char *file, struct stat
 struct finfo {
 	const char *from;
 	const char *to;
-	size_t size;
+	off_t size;
 };
 
 static void
-progress(const struct finfo *fi, size_t written)
+progress(const struct finfo *fi, off_t written)
 {
 	int pcent = (int)((100.0 * written) / fi->size);
 
 	pinfo = 0;
-	(void)fprintf(stderr, "%s => %s %zu/%zu bytes %d%% written\n",
-	fi->from, fi->to, written, fi->size, pcent);
+	(void)fprintf(stderr, "%s => %s %llu/%llu bytes %d%% written\n",
+	fi->from, fi->to, (unsigned long long)written,
+	(unsigned long long)fi->size, pcent);
 }
 
 int
@@ -97,7 +98,7 @@ copy_file(FTSENT *entp, int dne)
 	struct stat to_stat, *fs;
 	int ch, checkch, from_fd, rcount, rval, to_fd, tolnk, wcount;
 	char *p;
-	size_t ptotal = 0;
+	off_t ptotal = 0;
 	
 	if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) {
 		warn("%s", entp->fts_path);
@@ -184,7 +185,7 @@ copy_file(FTSENT *entp, int dne)
 
 		fi.from = entp->fts_path;
 		fi.to = to.p_path;
-		fi.size = (size_t)fs->st_size;
+		fi.size = fs->st_size;
 
 		/*
 		 * Mmap and write if less than 8M (the limit is so



CVS commit: [netbsd-7] src/bin/cp

2016-03-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar  6 18:44:10 UTC 2016

Modified Files:
src/bin/cp [netbsd-7]: cp.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1131):
bin/cp/cp.c: revision 1.59
The '-i' flag should work regardless of whether the standard input is
a terminal.  The Open Group notes this historic behavior and correctly
notes that it doesn't make much sense.  Note also, that mv(1) has
always respected its '-i' regardless of whether the standard input is
a terminal.
>From Timo Buhrmester.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.58.20.1 src/bin/cp/cp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/cp/cp.c
diff -u src/bin/cp/cp.c:1.58 src/bin/cp/cp.c:1.58.20.1
--- src/bin/cp/cp.c:1.58	Wed Jan  4 15:58:37 2012
+++ src/bin/cp/cp.c	Sun Mar  6 18:44:10 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $ */
+/* $NetBSD: cp.c,v 1.58.20.1 2016/03/06 18:44:10 martin Exp $ */
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -43,7 +43,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)cp.c	8.5 (Berkeley) 4/29/95";
 #else
-__RCSID("$NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $");
+__RCSID("$NetBSD: cp.c,v 1.58.20.1 2016/03/06 18:44:10 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -145,7 +145,7 @@ main(int argc, char *argv[])
 			iflag = 0;
 			break;
 		case 'i':
-			iflag = isatty(fileno(stdin));
+			iflag = 1;
 			fflag = 0;
 			break;
 		case 'l':