Kaynağa Gözat

avoid struct stat

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43070 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 yıl önce
ebeveyn
işleme
baa791e3e9
1 değiştirilmiş dosya ile 1 ekleme ve 2 silme
  1. 1 2
      lib/vector/Vlib/map.c

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

@@ -225,7 +225,6 @@ int Vect_copy(const char *in, const char *mapset, const char *out)
     struct Map_info In, Out;
     struct field_info *Fi, *Fin;
     char old_path[GPATH_MAX], new_path[GPATH_MAX], buf[GPATH_MAX];
-    struct stat info;
     const char *files[] = { GV_FRMT_ELEMENT, GV_COOR_ELEMENT,
 	GV_HEAD_ELEMENT, GV_HIST_ELEMENT,
 	GV_TOPO_ELEMENT, GV_SIDX_ELEMENT, GV_CIDX_ELEMENT,
@@ -276,7 +275,7 @@ int Vect_copy(const char *in, const char *mapset, const char *out)
 	sprintf(buf, "%s/%s", out, files[i]);
 	G__file_name(new_path, GV_DIRECTORY, buf, G_mapset());
 
-	if (stat(old_path, &info) == 0) {	/* file exists? */
+	if (access(old_path, F_OK) == 0) {	/* file exists? */
 	    G_debug(2, "copy %s to %s", old_path, new_path);
 	    if (copy_file(old_path, new_path)) {
 		G_warning(_("Unable to copy vector map <%s> to <%s>"),