BSD 3 development
[unix-history] / usr / src / cmd / cp.c
index 7af6362..7303883 100644 (file)
@@ -2,7 +2,7 @@
  * cp oldfile newfile
  */
 
  * cp oldfile newfile
  */
 
-#define        BSIZE   512
+#define        BSIZE   1024
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -72,13 +72,13 @@ char *from, *to;
        }
        while(n = read(fold,  iobuf,  BSIZE)) {
                if (n < 0) {
        }
        while(n = read(fold,  iobuf,  BSIZE)) {
                if (n < 0) {
-                       fprintf(stderr, "cp: read error\n");
+                       perror("cp: read");
                        close(fold);
                        close(fnew);
                        return(1);
                } else
                        if (write(fnew, iobuf, n) != n) {
                        close(fold);
                        close(fnew);
                        return(1);
                } else
                        if (write(fnew, iobuf, n) != n) {
-                               fprintf(stderr, "cp: write error.\n");
+                               perror("cp: write");
                                close(fold);
                                close(fnew);
                                return(1);
                                close(fold);
                                close(fnew);
                                return(1);