浏览代码

libgis: turn https://trac.osgeo.org/grass/changeset/67044 into debug (no fatal error)

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

+ 8 - 9
lib/gis/env.c

@@ -152,10 +152,7 @@ static int read_env(int loc)
         parse_env(fd, loc);
         parse_env(fd, loc);
         fclose(fd);
         fclose(fd);
     }
     }
-
-    if (!fd) /* reading failed, call fatal error */
-      G_fatal_error(_("Unable to read GISRC <%s>: %s"), loc, strerror(errno));
-
+    
     G_initialize_done(&st->init[loc]);
     G_initialize_done(&st->init[loc]);
     return 0;
     return 0;
 }
 }
@@ -172,9 +169,6 @@ static void force_read_env(int loc)
         parse_env(fd, loc);
         parse_env(fd, loc);
         fclose(fd);
         fclose(fd);
     }
     }
-    
-    if (!fd) /* reading failed, call fatal error */
-      G_fatal_error(_("Unable to read GISRC <%s>: %s"), loc, strerror(errno));
 }
 }
 
 
 
 
@@ -310,11 +304,12 @@ static void write_env(int loc)
 static FILE *open_env(const char *mode, int loc)
 static FILE *open_env(const char *mode, int loc)
 {
 {
     char buf[GPATH_MAX];
     char buf[GPATH_MAX];
+    FILE *fd;
 
 
     if (loc == G_VAR_GISRC) {
     if (loc == G_VAR_GISRC) {
 	if (!st->gisrc)
 	if (!st->gisrc)
 	    st->gisrc = getenv("GISRC");
 	    st->gisrc = getenv("GISRC");
-
+        
 	if (!st->gisrc) {
 	if (!st->gisrc) {
 	    G_fatal_error(_("GISRC - variable not set"));
 	    G_fatal_error(_("GISRC - variable not set"));
 	    return NULL;
 	    return NULL;
@@ -329,7 +324,11 @@ static FILE *open_env(const char *mode, int loc)
 	sprintf(buf, "%s/%s/VAR", G_location_path(), G_mapset());
 	sprintf(buf, "%s/%s/VAR", G_location_path(), G_mapset());
     }
     }
 
 
-    return fopen(buf, mode);
+    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;
 }
 }
 
 
 /*!
 /*!