Pārlūkot izejas kodu

avoid struct stat

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43071 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 gadi atpakaļ
vecāks
revīzija
3bc98069b9
1 mainītis faili ar 3 papildinājumiem un 4 dzēšanām
  1. 3 4
      lib/vector/Vlib/close.c

+ 3 - 4
lib/vector/Vlib/close.c

@@ -75,21 +75,20 @@ int Vect_close(struct Map_info *Map)
 	Map->plus.built == GV_BUILD_ALL) {
 	char buf[GPATH_MAX];
 	char file_path[GPATH_MAX];
-	struct stat info;
 
 	/* Delete old support files if available */
 	sprintf(buf, "%s/%s", GV_DIRECTORY, Map->name);
 
 	G__file_name(file_path, buf, GV_TOPO_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
 
 	G__file_name(file_path, buf, GV_SIDX_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
 
 	G__file_name(file_path, buf, GV_CIDX_ELEMENT, G_mapset());
-	if (stat(file_path, &info) == 0)	/* file exists? */
+	if (access(file_path, F_OK) == 0)	/* file exists? */
 	    unlink(file_path);
 
 	Vect_coor_info(Map, &CInfo);