Browse Source

d.mon: close file when listing monitors
print env variable on verbose mode


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@52347 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 13 năm trước cách đây
mục cha
commit
55e8892112
2 tập tin đã thay đổi với 12 bổ sung1 xóa
  1. 2 0
      display/d.mon/list.c
  2. 10 1
      display/d.mon/start.c

+ 2 - 0
display/d.mon/list.c

@@ -88,4 +88,6 @@ void list_cmd(const char *name, FILE *fd_out)
     while (G_getl2(buf, sizeof(buf) - 1, fd) != 0) {
 	fprintf(fd_out, "%s\n", buf);
     }
+    
+    fclose(fd);
 }

+ 10 - 1
display/d.mon/start.c

@@ -94,7 +94,16 @@ int start_mon(const char *name, const char *output, int select,
     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);