summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dmake/unix/runargv.c15
-rw-r--r--solenv/inc/tg_ext.mk6
2 files changed, 17 insertions, 4 deletions
diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c
index 5979d04bc546..4be342bbb273 100644
--- a/dmake/unix/runargv.c
+++ b/dmake/unix/runargv.c
@@ -553,8 +553,11 @@ char **cmd; /* Simulate a reference to *cmd. */
/* Restore stdout/stderr if needed. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
internal = 1;
@@ -593,8 +596,11 @@ char **cmd; /* Simulate a reference to *cmd. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
if(pid.pid == (DMHANDLE)-1) {
/* spawn failed */
@@ -649,8 +655,11 @@ char **cmd; /* Simulate a reference to *cmd. */
* failed. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
fprintf(stderr, "%s: Error executing '%s': %s",
Pname, argv[0], strerror(errno) );
diff --git a/solenv/inc/tg_ext.mk b/solenv/inc/tg_ext.mk
index 6a06591ab795..f000775b2279 100644
--- a/solenv/inc/tg_ext.mk
+++ b/solenv/inc/tg_ext.mk
@@ -47,7 +47,11 @@ LDFLAGS!:=$(EXTRA_LINKFLAGS) $(LDFLAGS)
.EXPORT : LDFLAGS
.ENDIF
-PATH!:=.:$(SOLARBINDIR):$(PATH)
+.IF "$(GUI)"=="WNT" && "$(USE_SHELL)"!="4nt"
+PATH!:=.:$(SOLARBINDIR:^"/cygdrive/":s/://):$(PATH)
+.ELSE # "$(GUI)"=="WNT" && "$(USE_SHELL)"!="4nt"
+PATH!:=.$(PATH_SEPERATOR)$(SOLARBINDIR)$(PATH_SEPERATOR)$(PATH)
+.ENDIF # "$(GUI)"=="WNT" && "$(USE_SHELL)"!="4nt"
.EXPORT : PATH
#override