[GRASS-SVN] r52347 - grass/trunk/display/d.mon

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 8 02:07:52 PDT 2012


Author: martinl
Date: 2012-07-08 02:07:51 -0700 (Sun, 08 Jul 2012)
New Revision: 52347

Modified:
   grass/trunk/display/d.mon/list.c
   grass/trunk/display/d.mon/start.c
Log:
d.mon: close file when listing monitors
       print env variable on verbose mode


Modified: grass/trunk/display/d.mon/list.c
===================================================================
--- grass/trunk/display/d.mon/list.c	2012-07-08 08:25:34 UTC (rev 52346)
+++ grass/trunk/display/d.mon/list.c	2012-07-08 09:07:51 UTC (rev 52347)
@@ -88,4 +88,6 @@
     while (G_getl2(buf, sizeof(buf) - 1, fd) != 0) {
 	fprintf(fd_out, "%s\n", buf);
     }
+    
+    fclose(fd);
 }

Modified: grass/trunk/display/d.mon/start.c
===================================================================
--- grass/trunk/display/d.mon/start.c	2012-07-08 08:25:34 UTC (rev 52346)
+++ grass/trunk/display/d.mon/start.c	2012-07-08 09:07:51 UTC (rev 52347)
@@ -94,7 +94,16 @@
     close(creat(cmd_value, 0666));
 
     G_verbose_message(_("Staring monitor <%s> with env file '%s'"), name, env_value);
-    
+    if (G_verbose() > G_verbose_std()) {
+        FILE *fd;
+        
+        fd = fopen(env_value, "r");
+        while (G_getl2(buf, sizeof(buf) - 1, fd) != 0) {
+            fprintf(stderr, " %s\n", buf);
+        }
+        fclose(fd);
+    }
+
     G_debug(1, "start: name=%s ", name);
     G_debug(3, "       envfile = %s", env_value);
     G_debug(3, "       cmdfile = %s", cmd_value);



More information about the grass-commit mailing list