浏览代码

libgis: revert r67044:5 (it causing strange compilation problem with g.mkfontcap -s)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67046 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 9 年之前
父节点
当前提交
01f5cdead6
共有 1 个文件被更改,包括 3 次插入10 次删除
  1. 3 10
      lib/gis/env.c

+ 3 - 10
lib/gis/env.c

@@ -17,8 +17,6 @@
 #include <stdlib.h>
 #include <unistd.h>		/* for sleep() */
 #include <string.h>
-#include <errno.h>
-
 #include <grass/gis.h>
 #include <grass/glocale.h>
 
@@ -152,7 +150,7 @@ static int read_env(int loc)
         parse_env(fd, loc);
         fclose(fd);
     }
-    
+
     G_initialize_done(&st->init[loc]);
     return 0;
 }
@@ -304,12 +302,11 @@ static void write_env(int loc)
 static FILE *open_env(const char *mode, int loc)
 {
     char buf[GPATH_MAX];
-    FILE *fd;
 
     if (loc == G_VAR_GISRC) {
 	if (!st->gisrc)
 	    st->gisrc = getenv("GISRC");
-        
+
 	if (!st->gisrc) {
 	    G_fatal_error(_("GISRC - variable not set"));
 	    return NULL;
@@ -324,11 +321,7 @@ static FILE *open_env(const char *mode, int loc)
 	sprintf(buf, "%s/%s/VAR", G_location_path(), G_mapset());
     }
 
-    fd = fopen(buf, mode);
-    if (!fd) /* reading failed, call fatal error */
-      G_debug(1, "Unable to read GISRC <%s>: %s", buf, strerror(errno));
-
-    return fd;
+    return fopen(buf, mode);
 }
 
 /*!