瀏覽代碼

Vlib: increase buffer to 4096 when copying files (sync to lib/gis/copy_dir.c)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72978 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 6 年之前
父節點
當前提交
e0a79948ba
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      lib/vector/Vlib/map.c

+ 3 - 2
lib/vector/Vlib/map.c

@@ -77,7 +77,7 @@ void Vect_destroy_map_struct(struct Map_info *p)
  */
 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 @@ static int copy_file(const char *src, const char *dst)
 
     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;
     }