Browse Source

/dev/null to G_DEV_NULL (trac https://trac.osgeo.org/grass/ticket/508; merge from devbr6)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36145 15284696-431f-4ddb-bdfa-cd5b030d7da7
Hamish Bowman 16 năm trước cách đây
mục cha
commit
16750a3610
3 tập tin đã thay đổi với 6 bổ sung6 xóa
  1. 1 1
      imagery/i.cluster/main.c
  2. 1 1
      lib/gis/opencell.c
  3. 4 4
      raster/r.topmodel/misc.c

+ 1 - 1
imagery/i.cluster/main.c

@@ -215,7 +215,7 @@ int main(int argc, char *argv[])
     }
     
     if ((reportfile = parm.report_file->answer) == NULL)
-	report = fopen("/dev/null", "w");
+	report = fopen(G_DEV_NULL, "w");
     else
 	report = fopen(reportfile, "w");
     if (report == NULL) {

+ 1 - 1
lib/gis/opencell.c

@@ -258,7 +258,7 @@ int G__open_cell_old(const char *name, const char *mapset)
     if (gdal) {
 #ifdef HAVE_GDAL
 	/* dummy descriptor to reserve the fileinfo slot */
-	fd = open("/dev/null", O_RDONLY);
+	fd = open(G_DEV_NULL, O_RDONLY);
 #else
 	G_warning(_("map <%s@%s> is a GDAL link but GRASS is compiled without GDAL support"),
 		  r_name, r_mapset);

+ 4 - 4
raster/r.topmodel/misc.c

@@ -38,7 +38,7 @@ void gregion(void)
     }
 
     if (hdmap) {
-	sprintf(buf, "g.region rast=%s > /dev/null", hdmap);
+	sprintf(buf, "g.region rast=%s --quiet", hdmap);
 	G_message("g.region rast=%s ... ", hdmap);
 
 	if (run(buf))
@@ -50,7 +50,7 @@ void gregion(void)
 void depressionless(void)
 {
     char buf[GPATH_MAX];
-    sprintf(buf, "r.fill.dir input=%s elev=%s dir=%s type=grass > /dev/null",
+    sprintf(buf, "r.fill.dir input=%s elev=%s dir=%s type=grass --quiet",
 	    map.elev, map.fill, map.dir);
     G_message("r.fill.dir input=%s elev=%s dir=%s type=grass ... ",
 	      map.elev, map.fill, map.dir);
@@ -68,7 +68,7 @@ void depressionless(void)
 void basin_elevation(void)
 {
     char buf[GPATH_MAX];
-    sprintf(buf, "r.mapcalc '%s = if(%s == 0 || isnull(%s), null(), %s)' > /dev/null",
+    sprintf(buf, "r.mapcalc '%s = if(%s == 0 || isnull(%s), null(), %s)' --quiet",
 	    map.belev, map.basin, map.basin, map.elev);
     G_message("r.mapcalc '%s = if(%s == 0 || isnull(%s), null(), %s)'"
 	      " ... ", map.belev, map.basin, map.basin, map.elev);
@@ -85,7 +85,7 @@ void top_index(void)
 {
     char buf[GPATH_MAX];
     if (map.belev) {
-	sprintf(buf, "r.topidx input=%s output=%s > /dev/null",
+	sprintf(buf, "r.topidx input=%s output=%s --quiet",
 		map.belev, map.topidx);
 	G_message("r.topidx input=%s output=%s ... ", map.belev, map.topidx);