Browse Source

SF_CLOSE_DESCRIPTOR should actually close the descriptor

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50497 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 13 years ago
parent
commit
f57c5fcc57
1 changed files with 3 additions and 1 deletions
  1. 3 1
      lib/gis/spawn.c

+ 3 - 1
lib/gis/spawn.c

@@ -433,8 +433,10 @@ static void do_redirects(struct redirect *redirects, int num_redirects, HANDLE h
 	else if (r->src_fd >= 0) {
 	    handles[r->dst_fd] = get_handle(r->src_fd);
 	}
-	else
+	else {
 	    handles[r->dst_fd] = INVALID_HANDLE_VALUE;
+	    close(r->dst_fd);
+	}
     }
 }