[GRASS-SVN] r36148 - in grass/branches/releasebranch_6_4: imagery/i.cluster lib/gis raster/r.topmodel

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 1 01:03:14 EST 2009


Author: hamish
Date: 2009-03-01 01:03:14 -0500 (Sun, 01 Mar 2009)
New Revision: 36148

Modified:
   grass/branches/releasebranch_6_4/imagery/i.cluster/main.c
   grass/branches/releasebranch_6_4/lib/gis/opencell.c
   grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c
Log:
/dev/null to G_DEV_NULL (trac #508; merge from devbr6)

Modified: grass/branches/releasebranch_6_4/imagery/i.cluster/main.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.cluster/main.c	2009-03-01 06:00:47 UTC (rev 36147)
+++ grass/branches/releasebranch_6_4/imagery/i.cluster/main.c	2009-03-01 06:03:14 UTC (rev 36148)
@@ -227,7 +227,7 @@
     verbose = !flag.q->answer;
 
     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) {

Modified: grass/branches/releasebranch_6_4/lib/gis/opencell.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/opencell.c	2009-03-01 06:00:47 UTC (rev 36147)
+++ grass/branches/releasebranch_6_4/lib/gis/opencell.c	2009-03-01 06:03:14 UTC (rev 36148)
@@ -257,7 +257,7 @@
     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);

Modified: grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c	2009-03-01 06:00:47 UTC (rev 36147)
+++ grass/branches/releasebranch_6_4/raster/r.topmodel/misc.c	2009-03-01 06:03:14 UTC (rev 36148)
@@ -37,7 +37,7 @@
     }
 
     if (hdmap) {
-	sprintf(buf, "%s/bin/g.region rast=%s > /dev/null", gisbase, hdmap);
+	sprintf(buf, "%s/bin/g.region rast=%s --quiet", gisbase, hdmap);
 	G_message("g.region rast=%s ... ", hdmap);
 
 	if (run(buf))
@@ -49,7 +49,7 @@
 void depressionless(void)
 {
     sprintf(buf, "%s/bin/r.fill.dir "
-	    "input=%s elev=%s dir=%s type=grass > /dev/null",
+	    "input=%s elev=%s dir=%s type=grass --quiet",
 	    gisbase, 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);
@@ -66,9 +66,12 @@
 
 void basin_elevation(void)
 {
+    /* be quiet */
+/*    G_putenv("GRASS_VERBOSE", "0");   how to unset in a cross-platform way afterwards? */
     sprintf(buf, "%s/bin/r.mapcalc "
-	    "'%s = if(%s == 0 || isnull(%s), null(), %s)' > /dev/null",
+	    "'%s = if(%s == 0 || isnull(%s), null(), %s)'",
 	    gisbase, 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);
 
@@ -84,7 +87,7 @@
 {
     if (map.belev) {
 	sprintf(buf, "%s/bin/r.topidx "
-		"input=%s output=%s > /dev/null",
+		"input=%s output=%s --quiet",
 		gisbase, map.belev, map.topidx);
 	G_message("r.topidx input=%s output=%s ... ", map.belev, map.topidx);
 



More information about the grass-commit mailing list