[GRASS-SVN] r72978 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 11 01:49:23 PDT 2018


Author: mmetz
Date: 2018-07-11 01:49:23 -0700 (Wed, 11 Jul 2018)
New Revision: 72978

Modified:
   grass/trunk/lib/vector/Vlib/map.c
Log:
Vlib: increase buffer to 4096 when copying files (sync to lib/gis/copy_dir.c)

Modified: grass/trunk/lib/vector/Vlib/map.c
===================================================================
--- grass/trunk/lib/vector/Vlib/map.c	2018-07-11 08:39:09 UTC (rev 72977)
+++ grass/trunk/lib/vector/Vlib/map.c	2018-07-11 08:49:23 UTC (rev 72978)
@@ -77,7 +77,7 @@
  */
 static int copy_file(const char *src, const char *dst)
 {
-    char buf[1024];
+    char buf[4096];
     int fd, fd2;
     FILE *f2;
     int len, len2;
@@ -93,7 +93,8 @@
 
     fd2 = fileno(f2);
 
-    while ((len = read(fd, buf, 1024)) > 0) {
+    len2 = 0;
+    while ((len = read(fd, buf, 4096)) > 0) {
         while (len && (len2 = write(fd2, buf, len)) >= 0)
             len -= len2;
     }



More information about the grass-commit mailing list